prometheus-client-c  0.1.1
Prometheus client for the C programming language
Typedefs | Functions
prom_metric_sample.h File Reference

Functions for interfacting with metric samples directly. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct prom_metric_sample prom_metric_sample_t
 Contains the specific metric and value given the name and label set Reference: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels.
 

Functions

int prom_metric_sample_add (prom_metric_sample_t *self, double r_value)
 Add the r_value to the sample. More...
 
int prom_metric_sample_sub (prom_metric_sample_t *self, double r_value)
 Subtract the r_value from the sample. More...
 
int prom_metric_sample_set (prom_metric_sample_t *self, double r_value)
 Set the r_value of the sample. More...
 

Detailed Description

Functions for interfacting with metric samples directly.

Function Documentation

◆ prom_metric_sample_add()

int prom_metric_sample_add ( prom_metric_sample_t self,
double  r_value 
)

Add the r_value to the sample.

The value must be greater than or equal to zero.

Parameters
selfThe target prom_metric_sample_t*
r_valueThe double to add to prom_metric_sample_t* provided by self
Returns
Non-zero integer value upon failure

◆ prom_metric_sample_set()

int prom_metric_sample_set ( prom_metric_sample_t self,
double  r_value 
)

Set the r_value of the sample.

This operation MUST be called on a sample derived from a gauge metric.

Parameters
selfThe target prom_metric_sample_t*
r_valueThe double which will be set to the prom_metric_sample_t* provided by self
Returns
Non-zero integer value upon failure

◆ prom_metric_sample_sub()

int prom_metric_sample_sub ( prom_metric_sample_t self,
double  r_value 
)

Subtract the r_value from the sample.

This operation MUST be called a sample derived from a gauge metric.

Parameters
selfThe target prom_metric_sample_t*
r_valueThe double to subtract from the prom_metric_sample_t* provided by self
Returns
Non-zero integer value upon failure