Tor 0.4.9.0-alpha-dev
|
Header for lib/metrics/metrics_common.c. More...
Go to the source code of this file.
Data Structures | |
struct | metrics_histogram_bucket_t |
struct | metrics_counter_t |
struct | metrics_gauge_t |
struct | metrics_histogram_t |
Macros | |
#define | METRICS_STR(val) #val |
#define | METRICS_NAME(name) METRICS_STR(tor_ ## name) |
Enumerations | |
enum | metrics_format_t { METRICS_FORMAT_PROMETHEUS = 1 } |
enum | metrics_type_t { METRICS_TYPE_COUNTER , METRICS_TYPE_GAUGE , METRICS_TYPE_HISTOGRAM } |
Functions | |
const char * | metrics_type_to_str (const metrics_type_t type) |
const char * | metrics_format_label (const char *key, const char *value) |
Header for lib/metrics/metrics_common.c.
Definition in file metrics_common.h.
#define METRICS_NAME | ( | name | ) | METRICS_STR(tor_ ## name) |
Definition at line 18 of file metrics_common.h.
#define METRICS_STR | ( | val | ) | #val |
Helper macro that must be used to construct the right namespaced metrics name. A name is a string so stringify the result.
Definition at line 17 of file metrics_common.h.
enum metrics_format_t |
Format output type.
Enumerator | |
---|---|
METRICS_FORMAT_PROMETHEUS | Prometheus data output format. |
Definition at line 21 of file metrics_common.h.
enum metrics_type_t |
Metric type.
Definition at line 27 of file metrics_common.h.
const char * metrics_format_label | ( | const char * | key, |
const char * | value | ||
) |
Return a static buffer pointer that contains a formatted label on the form of key=value.
Subsequent call to this function invalidates the previous buffer.
Definition at line 39 of file metrics_common.c.
Referenced by fill_cc_counters_values(), fill_cc_gauges_values(), fill_circuits_values(), fill_dos_values(), fill_global_bw_limit_values(), fill_oom_values(), fill_relay_flags(), fill_single_connection_value(), fill_single_stream_value(), fill_socket_values(), and fill_traffic_values().
const char * metrics_type_to_str | ( | const metrics_type_t | type | ) |
Return string representation of a metric type.
Definition at line 20 of file metrics_common.c.
Referenced by prometheus_format_store_entry().