Tor  0.4.7.0-alpha-dev
relay_metrics.h
Go to the documentation of this file.
1 /* Copyright (c) 2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * @file relay_metrics.h
6  * @brief Header for feature/relay/relay_metrics.c
7  **/
8 
9 #ifndef TOR_FEATURE_RELAY_RELAY_METRICS_H
10 #define TOR_FEATURE_RELAY_RELAY_METRICS_H
11 
14 
15 /** Metrics key for each reported metrics. This key is also used as an index in
16  * the base_metrics array. */
17 typedef enum {
18  /** Number of OOM invocation. */
20  /** Number of onionskines handled. */
22  /** Number of sockets. */
24  /** Number of global connection rate limit. */
26  /** Number of DNS queries. */
28  /** Number of DNS query errors. */
30  /** Number of TCP exhaustion reached. */
33 
34 /** The metadata of a relay metric. */
35 typedef struct relay_metrics_entry_t {
36  /* Metric key used as a static array index. */
38  /* Metric type. */
39  metrics_type_t type;
40  /* Metrics output name. */
41  const char *name;
42  /* Metrics output help comment. */
43  const char *help;
44  /* Update value function. */
45  void (*fill_fn)(void);
47 
48 /* Init. */
49 void relay_metrics_init(void);
50 void relay_metrics_free(void);
51 
52 /* Accessors. */
54 
55 #endif /* !defined(TOR_FEATURE_RELAY_RELAY_METRICS_H) */
Header for lib/metrics/metrics_common.c.
metrics_type_t
relay_metrics_key_t
Definition: relay_metrics.h:17
@ RELAY_METRICS_NUM_GLOBAL_RW_LIMIT
Definition: relay_metrics.h:25
@ RELAY_METRICS_NUM_TCP_EXHAUSTION
Definition: relay_metrics.h:31
@ RELAY_METRICS_NUM_SOCKETS
Definition: relay_metrics.h:23
@ RELAY_METRICS_NUM_ONIONSKINS
Definition: relay_metrics.h:21
@ RELAY_METRICS_NUM_DNS
Definition: relay_metrics.h:27
@ RELAY_METRICS_NUM_DNS_ERRORS
Definition: relay_metrics.h:29
@ RELAY_METRICS_NUM_OOM_BYTES
Definition: relay_metrics.h:19
void relay_metrics_init(void)
const smartlist_t * relay_metrics_get_stores(void)
void relay_metrics_free(void)
Header for smartlist.c.
Definition: relay_metrics.h:35