prometheus-client-c: prom/include/prom_gauge.h Source File

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

prom_gauge.h
Go to the documentation of this file.
1 /*
2 Copyright 2019-2020 DigitalOcean Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
22 #ifndef PROM_GAUGE_H
23 #define PROM_GAUGE_H
24
25 #include <stdlib.h>
26
27 #include "prom_metric.h"
28
35 typedef prom_metric_t prom_gauge_t;
36
54 prom_gauge_t *prom_gauge_new(const char *name, const char *help, size_t label_key_count, const char **label_keys);
55
62 int prom_gauge_destroy(prom_gauge_t *self);
63
79 int prom_gauge_inc(prom_gauge_t *self, const char **label_values);
80
96 int prom_gauge_dec(prom_gauge_t *self, const char **label_values);
97
115 int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values);
116
134 int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values);
135
153 int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values);
154
155 #endif // PROM_GAUGE_H
prom_gauge_new
prom_gauge_t * prom_gauge_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)
Constructs a prom_gauge_t*.
prom_metric_t
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:34
prom_gauge_sub
int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values)
Subtract the value to the prom_gauge.
prom_gauge_dec
int prom_gauge_dec(prom_gauge_t *self, const char **label_values)
Decrement the prom_gauge_t* by 1.
prom_gauge_t
prom_metric_t prom_gauge_t
A prometheus gauge.
Definition: prom_gauge.h:35
prom_gauge_add
int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values)
Add the value to the prom_gauge_t*.
prom_gauge_inc
int prom_gauge_inc(prom_gauge_t *self, const char **label_values)
Increment the prom_gauge_t* by 1.
prom_gauge_set
int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values)
Set the value for the prom_gauge_t*.
prom_gauge_destroy
int prom_gauge_destroy(prom_gauge_t *self)
Destroys a prom_gauge_t*.
prom_metric.h
Functions for retrieving metric samples from metrics given an ordered set of labels.