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

DM-37302: lsst.verify.TimingMetricTask does not return wall-clock time #107

Merged
merged 4 commits into from Jan 31, 2023

Conversation

kfindeisen
Copy link
Member

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.

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`.

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?

Copy link
Member Author

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.

python/lsst/verify/tasks/commonMetrics.py Outdated Show resolved Hide resolved


# Expose CpuTimingMetricConfig name because config-writers expect it
CpuTimingMetricConfig = TimeMethodMetricConfig

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

tests/test_commonMetrics.py Outdated Show resolved Hide resolved
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.
@kfindeisen kfindeisen merged commit af8dc10 into main Jan 31, 2023
@kfindeisen kfindeisen deleted the tickets/DM-37302 branch January 31, 2023 20:39
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.

None yet

2 participants