libprom @VERSION@
C based libraries to expose metrics in Promtheus exposition format
Loading...
Searching...
No Matches
prom_gauge.h
Go to the documentation of this file.
1/*
2Copyright 2019-2020 DigitalOcean Inc.
3Copyright 2021 Jens Elkner <jel+libprom@cs.uni-magdeburg.de>
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16*/
17
23#ifndef PROM_GAUGE_H
24#define PROM_GAUGE_H
25
26#include <stdlib.h>
27
28#include "prom_metric.h"
29
37
55prom_gauge_t *prom_gauge_new(const char *name, const char *help, size_t label_key_count, const char **label_keys);
56
65
84int prom_gauge_inc(prom_gauge_t *self, const char **label_values);
85
104int prom_gauge_dec(prom_gauge_t *self, const char **label_values);
105
125int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values);
126
146int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values);
147
167int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values);
168
169#endif // PROM_GAUGE_H
int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values)
Set the given gauge to the given value.
prom_metric_t prom_gauge_t
Prometheus metric: gauge.
Definition prom_gauge.h:36
prom_gauge_t * prom_gauge_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)
Construct a new metric of type gauge (or short: gauge).
int prom_gauge_destroy(prom_gauge_t *self)
Destroys the given gauge.
int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values)
Subtract the value to the given gauge.
int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values)
Add the given value to the given gauge.
int prom_gauge_dec(prom_gauge_t *self, const char **label_values)
Decrement the given gauge by 1.
int prom_gauge_inc(prom_gauge_t *self, const char **label_values)
Increment the given gauge by 1.
Functions for retrieving metric samples from metrics given an ordered set of labels.
struct prom_metric prom_metric_t
A prometheus metric.
Definition prom_metric.h:43