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
DM-37302: lsst.verify.TimingMetricTask does not return wall-clock time #107
Conversation
The documentation and examples for MetadataMetricTask and its subtasks refer to Gen 2 tasks, and predate the addition of the labelName template.
================== | ||
|
||
``CpuTimingMetricTask`` searches the metadata for @\ `~lsst.utils.timer.timeMethod`-generated keys corresponding to the method of interest. | ||
If it finds matching keys, it stores the elapsed time as a `~lsst.verify.Measurement`. |
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.
What does it do if they are not there, just return?
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.
Or raise NoWorkFound
; that's part of the MetricTask
spec.
|
||
|
||
# Expose CpuTimingMetricConfig name because config-writers expect it | ||
CpuTimingMetricConfig = TimeMethodMetricConfig |
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.
Is it better to set one equal, or make a trivial subclass? It probably wont make much difference, but consider if anything will ever use class identity somewhere
This member was useful for the original (2019-era) tests, but API improvements and the transition to Gen 3 have made it irrelevant.
The new task has the behavior of the old TimingMetricTask, but explicitly measures CPU time.
TimingMetricTask was always advertised as measuring wall time, but the previous implementation measured CPU time. This is a significant rewrite of the task, and the unit tests have been updated to use the appropriate metadata keys.
1196966
to
3886c0d
Compare
This PR fixes the implementation of
TimingMetricTask
to return the wall-clock time, as advertised, instead of the CPU time. It creates a new task,CpuTimingMetricTask
, that preserves the old implementation under a more accurate name.