CpuTimingMetricTask#

class lsst.verify.tasks.CpuTimingMetricTask(**kwargs)#

Bases: MetadataMetricTask

A Task that computes a CPU time using metadata produced by the lsst.utils.timer.timeMethod decorator.

Parameters#

args kwargs

Constructor parameters are the same as for lsst.verify.tasks.MetricTask.

Methods Summary

getInputMetadataKeys(config)

Get search strings for the metadata.

makeMeasurement(timings)

Compute a wall-clock measurement from metadata provided by lsst.utils.timer.timeMethod.

Methods Documentation

classmethod getInputMetadataKeys(config)#

Get search strings for the metadata.

Parameters#

configcls.ConfigClass

Configuration for this task.

Returns#

keysdict

A dictionary of keys, optionally prefixed by one or more tasks in the format of lsst.pipe.base.Task.getFullMetadata().

"StartTime"

The key for when the target method started (str).

"EndTime"

The key for when the target method ended (str).

"StartTimestamp"

The key for an ISO 8601-compliant text string where the target method started (str).

"EndTimestamp"

The key for an ISO 8601-compliant text string where the target method ended (str).

makeMeasurement(timings)#

Compute a wall-clock measurement from metadata provided by lsst.utils.timer.timeMethod.

Parameters#

timingsdict [str, any]

A representation of the metadata passed to run. The dict has the following keys:

"StartTime"

The time the target method started (float or None).

"EndTime"

The time the target method ended (float or None).

"StartTimestamp", "EndTimestamp"

The start and end timestamps, in an ISO 8601-compliant format (str or None).

Returns#

measurementlsst.verify.Measurement

The running time of the target method.

Raises#

lsst.verify.tasks.MetricComputationError

Raised if the timing metadata are invalid.

lsst.pipe.base.NoWorkFound

Raised if no matching timing metadata found.