metrics_common.c File Reference

Common code for the metrics library. More...

#include <stddef.h>
#include "orconfig.h"
#include "lib/log/util_bug.h"
#include "lib/string/printf.h"
#include "lib/metrics/metrics_common.h"

Go to the source code of this file.


const char * metrics_type_to_str (const metrics_type_t type)
const char * metrics_format_label (const char *key, const char *value)

Detailed Description

Common code for the metrics library.

Definition in file metrics_common.c.

Function Documentation

◆ metrics_format_label()

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().

◆ metrics_type_to_str()

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().