MemoryMetricTask¶
MemoryMetricTask
creates a resident set size Measurement
based on data collected by @timeMethod
.
It reads the raw timing data from the top-level CmdLineTask
’s metadata, which is identified by the task configuration.
In general, it’s only useful to measure this metric for the top-level task being run.
@timeMethod
measures the peak memory usage from process start, so the results for any subtask will be contaminated by previous subtasks run on the same data ID.
Because @timeMethod
gives platform-dependent results, this task may give incorrect results (e.g., units) when run in a distributed system with heterogeneous nodes.
Processing summary¶
MemoryMetricTask
searches the metadata for @timeMethod
-generated keys corresponding to the method of interest.
If it finds matching keys, it stores the maximum memory usage as a Measurement
.
Python API summary¶
from lsst.verify.tasks.commonMetrics import MemoryMetricTask
-
class
(**kwargs)MemoryMetricTask
A Task that computes the maximum resident set size using metadata produced by the `lsst.pipe.base.timeMethod` decorator
...
-
attribute
config
Access configuration fields and retargetable subtasks.
See also
See the MemoryMetricTask
API reference for complete details.
Butler datasets¶
Input datasets¶
metadata
- The metadata of the top-level command-line task (e.g.,
ProcessCcdTask
,ApPipeTask
) being instrumented. Because the metadata produced by each top-level task is a different Butler dataset type, this dataset must be explicitly configured when runningMemoryMetricTask
or aMetricsControllerTask
that contains it.
Retargetable subtasks¶
No subtasks.
Configuration fields¶
metadata¶
- Data type
lsst.pipe.base.config.InputDatasetConfig
- Field type
ConfigField
metric¶
target¶
lsst.pipe.base.Task.getFullMetadata()
.Examples¶
from lsst.verify.tasks import MemoryMetricTask
config = MemoryMetricTask.ConfigClass()
config.metadata.name = "apPipe_metadata"
config.target = "apPipe:ccdProcessor.runDataRef"
config.metric = "pipe_tasks.ProcessCcdMemory"
task = MemoryMetricTask(config=config)
# config.metadata provided for benefit of MetricsControllerTask/Pipeline
# but since we've defined it we might as well use it
metadata = butler.get(config.metadata.name)
processCcdTime = task.run(metadata).measurement