https://prometheus.io/docs/concepts/metric_types/#histogram
More...
#include "stdlib.h"
Go to the source code of this file.
|
phb_t * | prom_histogram_default_buckets |
| default histogram buckets: .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10
|
|
https://prometheus.io/docs/concepts/metric_types/#histogram
- Note
- To get rid off braindamaged long names, you may replace
prom_histogram_bucket
with PHB
.
◆ phb_count()
size_t phb_count |
( |
phb_t * |
self | ) |
|
Get the number of valus in the given bucket.
- Parameters
-
- Returns
- The number of values in the bucket.
◆ phb_destroy()
int phb_destroy |
( |
phb_t * |
self | ) |
|
Destroy the given prom histogram bucket.
- Parameters
-
self | The bucket to destroy. |
- Returns
- Non-zero integer value upon failure, otherwise
0
.
- Note
- No matter what gets returned, you should never use any bucket passed to this function but set it to
NULL
.
◆ phb_exponential()
phb_t* phb_exponential |
( |
double |
start, |
|
|
double |
factor, |
|
|
size_t |
count |
|
) |
| |
Construct an exponentially sized prom histogram bucket.
- Parameters
-
start | The first inclusive upper bound. The value MUST be > 0. |
factor | The factor to apply to the previous upper bound to produce the next upper bound. The value MUST be greater than 1. |
count | The total number of buckets. The final +Inf bucket is not counted and not included. The value MUST be greater than or equal to 1. |
- Returns
- The new histogram bucket, or
NULL
if an error occured.
◆ phb_linear()
phb_t* phb_linear |
( |
double |
start, |
|
|
double |
width, |
|
|
size_t |
count |
|
) |
| |
Construct a linearly sized prom histogram bucket.
- Parameters
-
start | The first inclusive upper bound. |
width | The distance between each upper bound. |
count | The total number of buckets. The final +Inf bucket is not counted and not included. |
- Returns
- The constructed histogram bucket or
NULL
if an error occured.
◆ phb_new()
phb_t* phb_new |
( |
size_t |
count, |
|
|
double |
bucket, |
|
|
|
... |
|
) |
| |
Construct a new histogram bucket with the given values.
- Parameters
-
count | Number of buckets. |
bucket | count values to add to the bucket. |
- Returns
- The new histogram bucket, or
NULL
if an error occured.