Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
summary.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_SUMMARY_H_
8#define ZEPHYR_INCLUDE_PROMETHEUS_SUMMARY_H_
9
21
22#include <stddef.h>
23
31 double quantile;
33 double value;
34};
35
54
81#define PROMETHEUS_SUMMARY_DEFINE(_name, _detail) \
82 static STRUCT_SECTION_ITERABLE(prometheus_summary, _name) = {.base = (void *)(_detail), \
83 .quantiles = NULL, \
84 .num_quantiles = 0, \
85 .sum = 0, \
86 .count = 0}
87
98
103#endif /* ZEPHYR_INCLUDE_PROMETHEUS_SUMMARY_H_ */
int prometheus_summary_observe(struct prometheus_summary *summary, double value)
Observes a value in a Prometheus summary metric.
Prometheus metric interface.
Type used to represent a Prometheus metric base.
Definition metric.h:48
Prometheus summary quantile definition.
Definition summary.h:29
double value
Value of the quantile.
Definition summary.h:33
double quantile
Quantile of the summary.
Definition summary.h:31
Type used to represent a Prometheus summary metric.
Definition summary.h:42
struct prometheus_summary_quantile * quantiles
Array of quantiles associated with the Prometheus summary metric.
Definition summary.h:46
struct prometheus_metric * base
Base of the Prometheus summary metric.
Definition summary.h:44
unsigned long count
Total count of observations in the summary metric.
Definition summary.h:52
size_t num_quantiles
Number of quantiles associated with the Prometheus summary metric.
Definition summary.h:48
double sum
Sum of all observed values in the summary metric.
Definition summary.h:50