prometheus-client-c 0.1.1 Prometheus client for the C programming language

Classes | Typedefs | Functions | Variables
prom_histogram_buckets.h File Reference

https://prometheus.io/docs/concepts/metric_types/#histogram More...

`#include "stdlib.h"`
Include dependency graph for prom_histogram_buckets.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | prom_histogram_buckets

## Typedefs
typedef struct prom_histogram_buckets | prom_histogram_buckets_t

## Functions
prom_histogram_buckets_t * | prom_histogram_buckets_new (size_t count, double bucket,...)
| Construct a prom_histogram_buckets_t*. More...
prom_histogram_buckets_t * | prom_histogram_buckets_linear (double start, double width, size_t count)
| Construct a linearly sized prom_histogram_buckets_t*. More...
prom_histogram_buckets_t * | prom_histogram_buckets_exponential (double start, double factor, size_t count)
| Construct an exponentially sized prom_histogram_buckets_t*. More...
int | prom_histogram_buckets_destroy (prom_histogram_buckets_t *self)
| Destroy a prom_histogram_buckets_t*. More...
size_t | prom_histogram_buckets_count (prom_histogram_buckets_t *self)
| Get the count of buckets. More...

## Variables
prom_histogram_buckets_t * | prom_histogram_default_buckets
| the default histogram buckets: .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10

## Detailed Description

https://prometheus.io/docs/concepts/metric_types/#histogram

## Function Documentation

## ◆ prom_histogram_buckets_count()

size_t prom_histogram_buckets_count | ( | prom_histogram_buckets_t * | self | ) |

Get the count of buckets.

Parameters

  self | The target prom_histogram_buckets_t*

Returns
  The count of buckets

## ◆ prom_histogram_buckets_destroy()

int prom_histogram_buckets_destroy | ( | prom_histogram_buckets_t * | self | ) |

Destroy a prom_histogram_buckets_t*.

Self MUST be set to NULL after destruction. Returns a non-zero integer value upon failure.

Parameters

  self | The target prom_histogram_buckets_t*

Returns
  Non-zero integer value upon failure

## ◆ prom_histogram_buckets_exponential()

prom_histogram_buckets_t* prom_histogram_buckets_exponential | ( | double | start,
|  | double | factor,
|  | size_t | count
| ) |  |

Construct an exponentially sized prom_histogram_buckets_t*.

Parameters

  start | The first inclusive upper bound. The value MUST be greater than 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 constructed prom_histogram_buckets_t*

## ◆ prom_histogram_buckets_linear()

prom_histogram_buckets_t* prom_histogram_buckets_linear | ( | double | start,
|  | double | width,
|  | size_t | count
| ) |  |

Construct a linearly sized prom_histogram_buckets_t*.

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 prom_histogram_buckets_t*

## ◆ prom_histogram_buckets_new()

prom_histogram_buckets_t* prom_histogram_buckets_new | ( | size_t | count,
|  | double | bucket,
|  |  | ...
| ) |  |

Construct a prom_histogram_buckets_t*.

Parameters

  count | The number of buckets
  bucket | The first bucket. A variable number of bucket values may be passed. This quantity MUST equal the value passed as count.

Returns
  The constructed prom_histogram_buckets_t*