Prometheus histograms are cumulative: the bucket le="0.5" counts observations less than or equal to
0.5, including those in smaller buckets. Given observations and sorted upper bounds, return a list of
[bound, count] pairs, followed by ["+Inf", total_count].
Implement histogram. Input: values: list[float], bounds: list[float] (ascending). Returns: list[list].
def histogram(values: list[float], bounds: list[float]) -> list[list]:
return [[b, 0] for b in bounds] + [["+Inf", len(values)]]
Run executes the public tests. Submit grades against public and hidden tests.
Prometheus histograms are cumulative: the bucket le="0.5" counts observations less than or equal to
0.5, including those in smaller buckets. Given observations and sorted upper bounds, return a list of
[bound, count] pairs, followed by ["+Inf", total_count].
Implement histogram. Input: values: list[float], bounds: list[float] (ascending). Returns: list[list].
def histogram(values: list[float], bounds: list[float]) -> list[list]:
return [[b, 0] for b in bounds] + [["+Inf", len(values)]]
Run executes the public tests. Submit grades against public and hidden tests.