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
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:
- duration
float
Duration to add to the get() statistics.
- duration
- increment_put(duration: float) None ¶
Increment time for put().
- Parameters:
- duration
float
Duration to add to the put() statistics.
- duration
- instrument_get(log: Logger | LsstLogAdapter | None = None, msg: str | None = None) Iterator[None] ¶
Run code and increment get statistics.
- Parameters:
- log
logging.Logger
orNone
Logger to use for any timing information.
- msg
str
orNone
Any message to be included in log output.
- log