Tor  0.4.6.0-alpha-dev
hs_metrics_entry.c
Go to the documentation of this file.
1 /* Copyright (c) 2020, 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. */
hs_metrics_entry.h
Header for feature/hs/hs_metrics_entry.c.
base_metrics
const hs_metrics_entry_t base_metrics[]
Definition: hs_metrics_entry.c:21
ARRAY_LENGTH
#define ARRAY_LENGTH(x)
Definition: compat_compiler.h:222
base_metrics_size
const size_t base_metrics_size
Definition: hs_metrics_entry.c:65
compat_compiler.h
Utility macros to handle different features and behavior in different compilers.