Repository navigation
CPU and Max RSS Analysis tools - #675
ChrisPaulBennett wants to merge 46 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
I've merged in the previous changes to the SQL infrastructure that deals with task states. @oliver-sanders I've had to change some of your code that creates parts of the SQL query, mostly just to take into account the new join. |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
These changes appear to have broken compatibility with workflows run in earlier versions of Cylc. I tested the tasks GraphQL query on a workflow that ran in 8.4.4.dev and got an empty result
query {
tasks(live: false, workflows: ["wflow"]) {
name
}
}{
"data": {
"tasks": []
}
}|
This been fixed. Max RSS and CPU time will be 0, if no data is present. An update to the cylc-ui needs to be made to not show cpu time / max rss charts if there is no data |
Is there a way to make this null instead of 0? Because currently the UI can't tell the difference between no data and times that are actually zero (to the nearest whole second). |
This has been fixed in the UI repo |
This comment was marked as resolved.
This comment was marked as resolved.
e14ad5c to
83dbbd6
Compare
83dbbd6 to
0d31a9f
Compare
oliver-sanders
left a comment
There was a problem hiding this comment.
Some fields removed from the tests, not sure if this was purposeful?
| assert ret['started_time'] == '2022-12-14T15:01:00Z' | ||
| assert ret['state'] == 'succeeded' | ||
| assert ret['std_dev_queue_time'] == pytest.approx(0.0, 0.01) | ||
| assert ret['std_dev_run_time'] == pytest.approx(0.0, 0.01) | ||
| assert ret['std_dev_total_time'] == pytest.approx(0.0, 0.01) | ||
| assert ret['submit_num'] == 1 | ||
| assert ret['submitted_time'] == '2022-12-14T15:00:00Z' |
There was a problem hiding this comment.
Are we not testing started_time/submitted_time/state/submit_num any more?
| @@ -187,87 +249,115 @@ | |||
| assert ret['min_total_time'] == 600 | |||
| assert ret['name'] == 'Task_1' | |||
| assert ret['platform'] == 'MyPlatform' | |||
| assert ret['started_time'] == '2022-12-15T15:01:16Z' | |||
| assert ret['state'] == 'succeeded' | |||
| assert ret['std_dev_queue_time'] == pytest.approx(8.00, 0.01) | |||
| assert ret['std_dev_run_time'] == pytest.approx(52.0, 0.01) | |||
| assert ret['std_dev_total_time'] == pytest.approx(60.0, 0.01) | |||
| assert ret['submit_num'] == 1 | |||
| assert ret['submitted_time'] == '2022-12-15T15:00:00Z' | |||
There was a problem hiding this comment.
Are we not testing these fields any more?
| @@ -279,43 +369,29 @@ | |||
| assert ret['min_total_time'] == 600 | |||
| assert ret['name'] == 'Task_1' | |||
| assert ret['platform'] == 'MyPlatform' | |||
| assert ret['started_time'] == '2022-12-16T15:01:16Z' | |||
| assert ret['state'] == 'succeeded' | |||
| assert ret['std_dev_queue_time'] == pytest.approx(7.54, 0.01) | |||
| assert ret['std_dev_run_time'] == pytest.approx(49.02, 0.01) | |||
| assert ret['std_dev_total_time'] == pytest.approx(56.56, 0.01) | |||
| assert ret['submit_num'] == 1 | |||
| assert ret['submitted_time'] == '2022-12-16T15:00:00Z' | |||
There was a problem hiding this comment.
Are we not testing these fields any more?
There was a problem hiding this comment.
No. They we aren't. These values are not apart of the task query anymore. I've also removed submit_num.
| cylc_version = CylcVersion(description=sstrip(''' | ||
| Set the Cylc version that the workflow starts with. | ||
| ''') | ||
| ) | ||
| initial_cycle_point = CyclePoint( | ||
| description=sstrip(''' | ||
| ''')) |
There was a problem hiding this comment.
Can you revert this un-blackening?
There was a problem hiding this comment.
Re-blackened the file
There was a problem hiding this comment.
That's not what I meant. And it hasn't reverted these changes, which was all I was asking for
There was a problem hiding this comment.
To make this easier to review, I've reverted the formatting changes that were made to unrelated lines (blackened or un-blackened): acebd40
| else row[f"{prop}_quartile_3"] | ||
| ), | ||
| ] | ||
| def get_quartiles(row, prop: str) -> List[Optional[float]]: |
There was a problem hiding this comment.
(Try not to re-introduce the deprecated typing classes going forwards)
list[float | None]There was a problem hiding this comment.
Not done? But let's leave it as is now
4608862 to
acebd40
Compare
| # fill forwards from the nearest lower quartile | ||
| previous = None | ||
| for index, value in enumerate(quartiles): | ||
| if value is None: | ||
| quartiles[index] = previous | ||
| else: | ||
| previous = value | ||
| # fill any leading gaps backwards from the first available quartile | ||
| fallback = next((value for value in quartiles if value is not None), None) | ||
| return [fallback if value is None else value for value in quartiles] |
There was a problem hiding this comment.
This can be simpler with a rearrangement:
| # fill forwards from the nearest lower quartile | |
| previous = None | |
| for index, value in enumerate(quartiles): | |
| if value is None: | |
| quartiles[index] = previous | |
| else: | |
| previous = value | |
| # fill any leading gaps backwards from the first available quartile | |
| fallback = next((value for value in quartiles if value is not None), None) | |
| return [fallback if value is None else value for value in quartiles] | |
| # find the first existing quartile to use as the initial value | |
| previous = next((value for value in quartiles if value is not None), None) | |
| # fill forwards from the nearest lower quartile | |
| for index, value in enumerate(quartiles): | |
| if value is None: | |
| quartiles[index] = previous | |
| else: | |
| previous = value | |
| return quartiles |

This apart of 3 pull requests for adding CPU time and Max RSS analysis to the Cylc UI.
This adds the Max RSS and CPU time (as measured by cgroups) to the table view, box plot and time series views.
Linked to;
cylc/cylc-flow#6663
cylc/cylc-ui#2100
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).?.?.xbranch.