-
Notifications
You must be signed in to change notification settings - Fork 51
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
job-list: initialize queue stats #5712
job-list: initialize queue stats #5712
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5712 +/- ##
===========================================
+ Coverage 55.38% 83.46% +28.08%
===========================================
Files 439 486 +47
Lines 75169 82933 +7764
===========================================
+ Hits 41631 69219 +27588
+ Misses 33538 13714 -19824
|
4e0bef5
to
613eee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just noticed a couple typos in the first commit.
@@ -45,18 +45,19 @@ static void free_wrapper (void **item) | |||
} | |||
|
|||
static struct job_stats *queue_stats_lookup (struct job_stats_ctx *statsctx, | |||
struct job *job) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message: looksup -> looks up
Also, 3 spaces between the period and "In a few cases..."
Problem: The internal queue_stats_lookup() function looks up a stats structure for a queue and creates one if it is missing. But in a few cases, this makes no sense. For example, when a job is being purged, it should be (generally) impossible that queue stats don't exist. Add a boolean indicating if the queue stats should be created or not in queue_stats_lookup(). In a few cases where it's undesireable for queue_stats_lookup() to return no queue stats, output some debugging error info. Also, have queue_stats_lookup() take a queue name instead of a "struct job" as input, as the queue name is what is actually necessary.
Problem: Job queue stats are generated in job-list when a job is submitted into it. If a job queue never has a job submitted to it, no job stats exist for the queue. This isn't what users would expect, they should expect queue stats to be 0 for the queue. Solution: Read the flux config and initialize queue stats to 0 for any queues that have been configured. Fixes flux-framework#5688
Problem: A test in t2260-job-list.t assumes there will be no job queue stats if a job has never been submitted to it. That behavior was recently changed. Update the test to check for non-empty queue stats for queues that should have no jobs "submitted" to it. Also add a new "nosubmitqueue" to the test for additional coverage.
Problem: CodeQL outputs a warning that an except clause is empty without a comment. Add a comment to eliminate the warning.
e9ad433
to
7958552
Compare
thanks! fixed, rebased, and setting MWP |
Problem: Job queue stats are generated in job-list when a job is submitted into it. If a job queue never has a job submitted to it, no job stats exist for the queue. This isn't what users would expect, they should expect queue stats to be 0 for the queue.
Solution: Read the flux config and initialize queue stats to 0 for any queues that have been configured.
Fixes #5688
Uhhh I clearly messed up my branch with rebasing somehow ... will fix
I'm not sure why a CodeQL warning showed up in this PR. I figured the "not a warning" in original PR was enough, but I guess not?? Or maybe b/c it was due to my messed up rebasing earlier. Anyways, I just added a tiny fix to fix it.
Oh yeah, side note. Implementation may look a little weird. Why have config_reload() call down into stats.[ch], why not put everything in stats.c? I needed config reload setup for another PR, so decided to just solve this issue first along the way.