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 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 
36 
54 prom_gauge_t* prom_gauge_new(const char *name,
55  const char *help,
56  size_t label_key_count,
57  const char **label_keys);
58 
66 
67 
83 int prom_gauge_inc(prom_gauge_t *self, const char **label_values);
84 
85 
101 int prom_gauge_dec(prom_gauge_t *self, const char **label_values);
102 
103 
121 int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values);
122 
123 
141 int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values);
142 
143 
161 int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values);
162 
163 #endif // PROM_GAUGE_H
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*.
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:34
int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values)
Subtract the value to the prom_gauge.
int prom_gauge_dec(prom_gauge_t *self, const char **label_values)
Decrement the prom_gauge_t* by 1.
prom_metric_t prom_gauge_t
A prometheus gauge.
Definition: prom_gauge.h:35
int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values)
Add the value to the prom_gauge_t*.
int prom_gauge_inc(prom_gauge_t *self, const char **label_values)
Increment the prom_gauge_t* by 1.
int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values)
Set the value for the prom_gauge_t*.
int prom_gauge_destroy(prom_gauge_t *self)
Destroys a prom_gauge_t*.
Functions for retrieving metric samples from metrics given an ordered set of labels.