Histogram implementation for Prometheus metrics.
Provides cumulative bucket histograms compatible with Prometheus format.
Histogram implementation for Prometheus metrics. Provides cumulative bucket histograms compatible with Prometheus format.
Default bucket boundaries for latency measurements (in seconds). Covers 1ms to 10s range with fine granularity for sub-100ms.
Default bucket boundaries for latency measurements (in seconds). Covers 1ms to 10s range with fine granularity for sub-100ms.
(format-histogram histogram metric-name labels)Format a histogram as Prometheus exposition format.
Returns a string with _bucket, _sum, and _count lines.
Format a histogram as Prometheus exposition format. Returns a string with _bucket, _sum, and _count lines.
(format-histogram-family histogram-map metric-name help-text label-keys)Format a family of histograms (same metric, different label combinations).
histogram-map: map of label-values -> histogram metric-name: the base metric name help-text: description for HELP line label-keys: ordered vector of label keys (e.g., [:proxy_name :target_id])
Format a family of histograms (same metric, different label combinations). histogram-map: map of label-values -> histogram metric-name: the base metric name help-text: description for HELP line label-keys: ordered vector of label keys (e.g., [:proxy_name :target_id])
(get-percentile histogram percentile)Estimate a percentile from histogram data. Note: This is an approximation based on bucket boundaries.
Estimate a percentile from histogram data. Note: This is an approximation based on bucket boundaries.
(histogram-stats histogram)Get basic statistics from a histogram.
Get basic statistics from a histogram.
(merge-histograms h1 h2)Merge two histograms with the same bucket boundaries.
Merge two histograms with the same bucket boundaries.
(new-histogram)(new-histogram buckets)Create a new histogram with the given bucket boundaries.
Returns a map with: :buckets - vector of bucket upper bounds :counts - vector of cumulative counts per bucket :sum - running sum of all observations :count - total number of observations
Create a new histogram with the given bucket boundaries. Returns a map with: :buckets - vector of bucket upper bounds :counts - vector of cumulative counts per bucket :sum - running sum of all observations :count - total number of observations
(observe histogram value)Record an observation in the histogram.
Updates all buckets where the observation is <= the bucket boundary (cumulative histogram as required by Prometheus).
Record an observation in the histogram. Updates all buckets where the observation is <= the bucket boundary (cumulative histogram as required by Prometheus).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |