Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
histogram.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Mustafa Abdullah Kus, Sparse Technology
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_PROMETHEUS_HISTOGRAM_H_
8#define ZEPHYR_INCLUDE_PROMETHEUS_HISTOGRAM_H_
9
21
22#include <stddef.h>
23
33 unsigned long count;
34};
35
54
80#define PROMETHEUS_HISTOGRAM_DEFINE(_name, _detail) \
81 static STRUCT_SECTION_ITERABLE(prometheus_histogram, _name) = {.base = (void *)(_detail), \
82 .buckets = NULL, \
83 .num_buckets = 0, \
84 .sum = 0, \
85 .count = 0}
86
96int prometheus_histogram_observe(struct prometheus_histogram *histogram, double value);
97
102#endif /* ZEPHYR_INCLUDE_PROMETHEUS_HISTOGRAM_H_ */
int prometheus_histogram_observe(struct prometheus_histogram *histogram, double value)
Observe a value in a Prometheus histogram metric.
Prometheus metric interface.
Prometheus histogram bucket definition.
Definition histogram.h:29
unsigned long count
Cumulative count of observations in the bucket.
Definition histogram.h:33
double upper_bound
Upper bound value of bucket.
Definition histogram.h:31
Type used to represent a Prometheus histogram metric.
Definition histogram.h:42
size_t num_buckets
Number of buckets in the histogram.
Definition histogram.h:48
struct prometheus_histogram_bucket * buckets
Array of buckets in the histogram.
Definition histogram.h:46
double sum
Sum of all observed values in the histogram.
Definition histogram.h:50
unsigned long count
Total count of observations in the histogram.
Definition histogram.h:52
struct prometheus_metric * base
Base of the Prometheus histogram metric.
Definition histogram.h:44
Type used to represent a Prometheus metric base.
Definition metric.h:48