simplebench.stats.operations_per_interval module🔗
Container for OperationsPerInterval benchmark statistics
- class simplebench.stats.operations_per_interval.OperationsPerInterval(
- *,
- iterations: Sequence[Iteration] | None = None,
- unit: str = 'Ops/s',
- scale: float = 1.0,
- rounds: int = 1,
- data: Sequence[int | float] | None = None,
Bases:
StatsContainer for the operations per time interval statistics of a benchmark.
- Variables:
unit (str) – The unit of measurement for the benchmark (e.g., “ops/s”).
scale (float) – The scale factor for the interval (e.g. 1 for seconds).
rounds (int) – The number of data points in the benchmark.
mean (float) – The mean operations per time interval.
median (float) – The median operations per time interval.
minimum (float) – The minimum operations per time interval.
maximum (float) – The maximum operations per time interval.
standard_deviation (float) – The standard deviation of operations per time interval.
relative_standard_deviation (float) – The relative standard deviation of ops per time interval.
percentiles (dict[int, float]) – Percentiles of operations per time interval.
Construct OperationsPerInterval stats from Iteration or raw ops data.
- Parameters:
iterations – List of
Iterationobjects to extract ops data from.unit – The unit of measurement for the benchmark (e.g., “ops/s”).
scale – The scale factor for the interval (e.g. 1 for seconds).
rounds – The number of data points in the benchmark.
data – Optional list of ops data points. If not provided, ops data will be extracted from the iterations if available.
- Raises:
SimpleBenchTypeError – If any of the arguments are of the wrong type.
SimpleBenchValueError – If any of the arguments have invalid values.
- class simplebench.stats.operations_per_interval.OperationsPerIntervalSummary(
- *,
- unit: str,
- scale: float,
- rounds: int,
- mean: float,
- median: float,
- minimum: float,
- maximum: float,
- standard_deviation: float,
- relative_standard_deviation: float,
- percentiles: tuple[float, ...],
Bases:
StatsSummarySummary of OperationsPerInterval statistics.
- Variables:
unit (str) – The unit of measurement for the benchmark (e.g., “ops/s”).
scale (float) – The scale factor for the interval (e.g. 1 for seconds).
rounds (int) – The number of data points in the benchmark.
mean (float) – The mean operations per time interval.
median (float) – The median operations per time interval.
minimum (float) – The minimum operations per time interval.
maximum (float) – The maximum operations per time interval.
standard_deviation (float) – The standard deviation of operations per time interval.
relative_standard_deviation (float) – The relative standard deviation of ops per time interval.
percentiles (dict[int, float]) – Percentiles of operations per time interval.
Initialize the StatsSummary object.
- Parameters:
unit (str) – The unit of measurement for the data (e.g., “ops/s”).
scale (float) – The scale factor the data (e.g. 1.0 for seconds).
rounds (int) – The number of rounds each data point represents.
mean (float) – The mean data point.
median (float) – The median data point.
minimum (float) – The minimum data point.
maximum (float) – The maximum data point.
standard_deviation (float) – The standard deviation of data.
relative_standard_deviation (float) – The relative standard deviation of data.
- Raises:
SimpleBenchTypeError – If any of the arguments are of the wrong type.
SimpleBenchValueError – If any of the arguments have invalid values.