ButlerMetrics#

class lsst.daf.butler.ButlerMetrics(*, time_in_put: float = 0.0, time_in_get: float = 0.0, n_get: int = 0, n_put: int = 0)#

Bases: BaseModel

Metrics collected during Butler operations.

Attributes Summary

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Methods Summary

increment_get(duration)

Increment time for get().

increment_put(duration)

Increment time for put().

instrument_get([log, msg])

Run code and increment get statistics.

instrument_put([log, msg])

Run code and increment put statistics.

reset()

Reset all metrics.

Attributes Documentation

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Methods Documentation

increment_get(duration: float) None#

Increment time for get().

Parameters#

durationfloat

Duration to add to the get() statistics.

increment_put(duration: float) None#

Increment time for put().

Parameters#

durationfloat

Duration to add to the put() statistics.

instrument_get(log: Logger | LsstLogAdapter | None = None, msg: str | None = None) Iterator[None]#

Run code and increment get statistics.

Parameters#

loglogging.Logger or None

Logger to use for any timing information.

msgstr or None

Any message to be included in log output.

instrument_put(log: Logger | LsstLogAdapter | None = None, msg: str | None = None) Iterator[None]#

Run code and increment put statistics.

Parameters#

loglogging.Logger or None

Logger to use for any timing information.

msgstr or None

Any message to be included in log output.

reset() None#

Reset all metrics.