prometheus-client-c  0.1.1
Prometheus client for the C programming language
prom_counter.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 
17 #ifndef PROM_COUNTER_H
18 #define PROM_COUNTER_H
19 
20 #include <stdlib.h>
21 
22 #include "prom_metric.h"
23 
36 
56 prom_counter_t *prom_counter_new(const char *name, const char *help, size_t label_key_count, const char **label_keys);
57 
65 
82 int prom_counter_inc(prom_counter_t *self, const char **label_values);
83 
101 int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values);
102 
103 #endif // PROM_COUNTER_H
int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values)
Add the value to the prom_counter_t*.
int prom_counter_inc(prom_counter_t *self, const char **label_values)
Increment the prom_counter_t by 1.
struct prom_metric prom_metric_t
A prometheus metric.
Definition: prom_metric.h:34
prom_metric_t prom_counter_t
A prometheus counter.
Definition: prom_counter.h:35
int prom_counter_destroy(prom_counter_t *self)
Destroys a prom_counter_t*.
Functions for retrieving metric samples from metrics given an ordered set of labels.
prom_counter_t * prom_counter_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)
Construct a prom_counter_t*.