Tor  0.4.7.0-alpha-dev
hs_metrics_entry.h
Go to the documentation of this file.
1 /* Copyright (c) 2020-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * @file hs_metrics_entry.h
6  * @brief Header for feature/hs/hs_metrics_entry.c
7  **/
8 
9 #ifndef TOR_FEATURE_HS_METRICS_ENTRY_H
10 #define TOR_FEATURE_HS_METRICS_ENTRY_H
11 
12 #ifdef HS_METRICS_ENTRY_PRIVATE
13 
15 
16 /** Metrics key which are used as an index in the main base metrics array. */
17 typedef enum {
18  /** Number of introduction requests. */
19  HS_METRICS_NUM_INTRODUCTIONS = 0,
20  /** Number of bytes written from onion service to application. */
21  HS_METRICS_APP_WRITE_BYTES = 1,
22  /** Number of bytes read from application to onion service. */
23  HS_METRICS_APP_READ_BYTES = 2,
24  /** Number of established rendezsvous. */
25  HS_METRICS_NUM_ESTABLISHED_RDV = 3,
26  /** Number of rendezsvous circuits created. */
27  HS_METRICS_NUM_RDV = 4,
28  /** Number of established introducton points. */
29  HS_METRICS_NUM_ESTABLISHED_INTRO = 5,
30 } hs_metrics_key_t;
31 
32 /** The metadata of an HS metrics. */
33 typedef struct hs_metrics_entry_t {
34  /* Metric key used as a static array index. */
35  hs_metrics_key_t key;
36  /* Metric type. */
37  metrics_type_t type;
38  /* Metrics output name. */
39  const char *name;
40  /* Metrics output help comment. */
41  const char *help;
42  /* True iff a port label should be added to the metrics entry. */
43  bool port_as_label;
44 } hs_metrics_entry_t;
45 
46 extern const hs_metrics_entry_t base_metrics[];
47 extern const size_t base_metrics_size;
48 
49 #endif /* defined(HS_METRICS_ENTRY_PRIVATE) */
50 
51 #endif /* !defined(TOR_FEATURE_HS_METRICS_ENTRY_H) */
const char * name
Definition: config.c:2434
const hs_metrics_entry_t base_metrics[]
const size_t base_metrics_size
Header for lib/metrics/metrics_common.c.
metrics_type_t