Tor  0.4.7.0-alpha-dev
hs_metrics_entry.c
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.c
6  * @brief Defines the metrics entry that are collected by an onion service.
7  **/
8 
9 #define HS_METRICS_ENTRY_PRIVATE
10 
11 #include "orconfig.h"
12 
13 #include "lib/cc/compat_compiler.h"
14 
16 
17 /** The base metrics that is a static array of metrics that are added to every
18  * single new stores.
19  *
20  * The key member MUST be also the index of the entry in the array. */
21 const hs_metrics_entry_t base_metrics[] =
22 {
23  {
24  .key = HS_METRICS_NUM_INTRODUCTIONS,
25  .type = METRICS_TYPE_COUNTER,
26  .name = METRICS_NAME(hs_intro_num_total),
27  .help = "Total number of introduction received",
28  .port_as_label = false,
29  },
30  {
31  .key = HS_METRICS_APP_WRITE_BYTES,
32  .type = METRICS_TYPE_COUNTER,
33  .name = METRICS_NAME(hs_app_write_bytes_total),
34  .help = "Total number of bytes written to the application",
35  .port_as_label = true,
36  },
37  {
38  .key = HS_METRICS_APP_READ_BYTES,
39  .type = METRICS_TYPE_COUNTER,
40  .name = METRICS_NAME(hs_app_read_bytes_total),
41  .help = "Total number of bytes read from the application",
42  .port_as_label = true,
43  },
44  {
45  .key = HS_METRICS_NUM_ESTABLISHED_RDV,
46  .type = METRICS_TYPE_GAUGE,
47  .name = METRICS_NAME(hs_rdv_established_count),
48  .help = "Total number of established rendezvous circuit",
49  },
50  {
51  .key = HS_METRICS_NUM_RDV,
52  .type = METRICS_TYPE_COUNTER,
53  .name = METRICS_NAME(hs_rdv_num_total),
54  .help = "Total number of rendezvous circuit created",
55  },
56  {
57  .key = HS_METRICS_NUM_ESTABLISHED_INTRO,
58  .type = METRICS_TYPE_GAUGE,
59  .name = METRICS_NAME(hs_intro_established_count),
60  .help = "Total number of established introduction circuit",
61  },
62 };
63 
64 /** Size of base_metrics array that is number of entries. */
Utility macros to handle different features and behavior in different compilers.
#define ARRAY_LENGTH(x)
const hs_metrics_entry_t base_metrics[]
const size_t base_metrics_size
Header for feature/hs/hs_metrics_entry.c.