Tor  0.4.6.0-alpha-dev
Data Structures | Macros | Enumerations | Functions
metrics_common.h File Reference

Header for lib/metrics/metrics_common.c. More...

#include "lib/cc/torint.h"

Go to the source code of this file.

Data Structures

struct  metrics_counter_t
 
struct  metrics_gauge_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 }
 

Functions

const char * metrics_type_to_str (const metrics_type_t type)
 

Detailed Description

Header for lib/metrics/metrics_common.c.

Definition in file metrics_common.h.

Macro Definition Documentation

◆ METRICS_STR

#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 16 of file metrics_common.h.

Enumeration Type Documentation

◆ metrics_format_t

Format output type.

Enumerator
METRICS_FORMAT_PROMETHEUS 

Prometheus data output format.

Definition at line 20 of file metrics_common.h.

◆ metrics_type_t

Metric type.

Definition at line 26 of file metrics_common.h.

Function Documentation

◆ 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 19 of file metrics_common.c.

Referenced by prometheus_format_store_entry().