prometheus-client-c  0.1.1
Prometheus client for the C programming language
prom_histogram_buckets.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 #include "stdlib.h"
23 
24 #ifndef PROM_HISTOGRAM_BUCKETS_H
25 #define PROM_HISTOGRAM_BUCKETS_H
26 
27 typedef struct prom_histogram_buckets {
28  int count;
29  const double *upper_bounds;
31 
39 prom_histogram_buckets_t *prom_histogram_buckets_new(size_t count, double bucket, ...);
40 
45 
53 prom_histogram_buckets_t *prom_histogram_buckets_linear(double start, double width, size_t count);
54 
64 prom_histogram_buckets_t *prom_histogram_buckets_exponential(double start, double factor, size_t count);
65 
73 
80 
81 #endif // PROM_HISTOGRAM_BUCKETS_H
prom_histogram_buckets_t * prom_histogram_default_buckets
the default histogram buckets: .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10
int count
Number of buckets.
Definition: prom_histogram_buckets.h:28
prom_histogram_buckets_t * prom_histogram_buckets_new(size_t count, double bucket,...)
Construct a prom_histogram_buckets_t*.
const double * upper_bounds
The bucket values.
Definition: prom_histogram_buckets.h:29
size_t prom_histogram_buckets_count(prom_histogram_buckets_t *self)
Get the count of buckets.
Definition: prom_histogram_buckets.h:27
int prom_histogram_buckets_destroy(prom_histogram_buckets_t *self)
Destroy a prom_histogram_buckets_t*.
prom_histogram_buckets_t * prom_histogram_buckets_linear(double start, double width, size_t count)
Construct a linearly sized prom_histogram_buckets_t*.
prom_histogram_buckets_t * prom_histogram_buckets_exponential(double start, double factor, size_t count)
Construct an exponentially sized prom_histogram_buckets_t*.