squirrel.iterstream.metrics
¶
There are two metrics used in squirrel.iterstream.base.Composable.monitor()
: metrics_iops()
and
metrics_throughput()
. They can be turned on and off by passing an instance of MetricsConf
to
monitor(..., metrics_conf=MetricsConf(...))
whenever it is being used.
Note
Both metrics are turned on be default. When one metric is on and the other is off, the labels of both metrics will
still be returned, but the actual value of the turned-off metric will be reported as 0. When both are turned off,
none will be handed over to the callback, and the original iterator simply passes through the method
monitor
.
The APIs of these functions and class are listed below:
Module Contents¶
Classes¶
A config data class controls 3 things: 1) whether the metric IOPS is calculated. 2) whether the metric throughput |
Functions¶
|
Returns number of items per second based on number of items and duration. |
|
Returns bytes IO per second based on the total size of items and duration. |
Attributes¶
-
squirrel.iterstream.metrics.
logger
¶
-
class
squirrel.iterstream.metrics.
MetricsConf
¶ A config data class controls 3 things: 1) whether the metric IOPS is calculated. 2) whether the metric throughput is calculated 3) and which throughput unit is being used.
- Parameters
-
iops
:bool = True¶
-
throughput
:bool = True¶
-
throughput_unit
:str = MB¶
-
asdict
() → Dict¶ Returns the sample as a dictionary