package core_bench
Module Bench.QuotaSource
A quota can be specified as an amount of wall time, or a number of times to run the function.
(Strictly speaking, for Num_calls n, it is possible that the function is called fewer than n times if the array of measurements fills up. But with default settings for how batches are sized, you don't run into this issue until n is over 1.9e16.)
include Core.Bin_prot.Binable.S with type t := t
Examples:
- "10" -> Span 10s (float-like: convert to seconds)
- "1m" -> Span 1m (span-like: keep as span)
- "5x" -> Num_calls 5
- "1e9x" -> Num_calls 1_000_000_000
fulfilled t ~start ~num_calls returns true iff we have fulfilled the quota, given that we *started* at time start and have run the function num_calls times.
max_count (Num_calls n) returns n, max_count (Span _) returns max_int.