libprom  @VERSION@
C based libraries to expose metrics in Promtheus exposition format
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 pms pms_t
 Contains the specific metric and value given the name and label set. More...
 

Functions

int pms_add (pms_t *self, double r_value)
 Add the given r_value to the given sample. More...
 
int pms_sub (pms_t *self, double r_value)
 Subtract the given r_value from the given sample. More...
 
int pms_set (pms_t *self, double r_value)
 Set the given r_value to the given ample. More...
 

Detailed Description

Functions for interfacting with metric samples directly.

Typedef Documentation

◆ pms_t

typedef struct pms pms_t

Contains the specific metric and value given the name and label set.

Note
All operations MUST be called on a sample derived from a gauge metric. Reference: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels

Function Documentation

◆ pms_add()

int pms_add ( pms_t self,
double  r_value 
)

Add the given r_value to the given sample.

Parameters
selfWhere to add the given value.
r_valueValue to add. Must be >= 0.
Returns
Non-zero integer value upon failure, 0 otherwise.

◆ pms_set()

int pms_set ( pms_t self,
double  r_value 
)

Set the given r_value to the given ample.

Parameters
selfWhere to set the given value.
r_valueValue to set.
Returns
Non-zero integer value upon failure, 0 otherwise.

◆ pms_sub()

int pms_sub ( pms_t self,
double  r_value 
)

Subtract the given r_value from the given sample.

Parameters
selfWhere to add the given value.
r_valueValue to substract.
Returns
Non-zero integer value upon failure, 0 otherwise.