Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVPROD-4573: Query hosts by Running status for Task Queue UI #7690

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

SupaJoon
Copy link
Contributor

@SupaJoon SupaJoon commented Mar 28, 2024

DEVPROD-4573

Description

These queries hosts by the running status for the Task Queue UI host count. Originally, the hostCount considered hosts with any of these statuses but now it only considers running.

@SupaJoon SupaJoon requested a review from a team March 28, 2024 17:01
globals.go Outdated
@@ -956,11 +956,10 @@ var (
HostStarting,
}

// Hosts in "initializing" status aren't actually running yet:
// Hosts in "initializing" and "building" status aren't actually running yet:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to open the ticket because of the Jira outage, but is the context for this the idea of omitting building hosts from the task queue page? Can that query instead just use the running status? (That's the only status that's able to run tasks in this list, so its the only status we should consider). The comment as you've edited it here is false; "Building" hosts are running hosts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, I will update this PR so the host count on the Task Queue page represents the Running status only.

@SupaJoon SupaJoon changed the title DEVPROD-4573: Omit 'building' from active host status list DEVPROD-4573: Query hosts by Running status Apr 3, 2024
@SupaJoon SupaJoon changed the title DEVPROD-4573: Query hosts by Running status DEVPROD-4573: Query hosts by Running status for Task Queue UI Apr 3, 2024
@SupaJoon SupaJoon requested a review from ablack12 April 3, 2024 17:46
Copy link
Contributor

@ablack12 ablack12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits

model/host/db.go Outdated
@@ -232,6 +232,16 @@ func runningHostsQuery(distroID string) bson.M {
return query
}

// byRunningStatusQuery produces a query that returns all hosts
// with the running status that belong to the given.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing "distro" and the end there i think

model/host/db.go Outdated
@@ -263,6 +273,11 @@ func CountRunningHosts(ctx context.Context, distroID string) (int, error) {
return num, errors.Wrap(err, "counting running hosts")
}

func CountRunningStatusHosts(ctx context.Context, distroID string) (int, error) {
num, err := Count(ctx, byRunningStatusQuery(distroID))
return num, errors.Wrap(err, "counting Running status hosts")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: shouldn't capitalize running

@SupaJoon SupaJoon merged commit 1cec854 into evergreen-ci:main Apr 4, 2024
8 checks passed
@SupaJoon SupaJoon deleted the DEVPROD-4573 branch April 4, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants