summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_metrics.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-10-20 15:05:06 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-10-27 10:43:42 -0400
commit97731196c4141093f96b632ce38f440fec8db831 (patch)
tree83ef95e306fbbdf1070e08579b2775140407c5e6 /src/feature/hs/hs_metrics.h
parentc081bee38a428dda2bd9ee043f7cbab3cbd77393 (diff)
downloadtor-97731196c4141093f96b632ce38f440fec8db831.tar.gz
tor-97731196c4141093f96b632ce38f440fec8db831.zip
hs: Collect introduction circuit metrics
Tracks the total number of established introduction circuit. Related to #40063 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_metrics.h')
-rw-r--r--src/feature/hs/hs_metrics.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/feature/hs/hs_metrics.h b/src/feature/hs/hs_metrics.h
index 21af42e01c..506831b3fd 100644
--- a/src/feature/hs/hs_metrics.h
+++ b/src/feature/hs/hs_metrics.h
@@ -57,4 +57,14 @@ void hs_metrics_update_by_service(const hs_metrics_key_t key,
#define hs_metrics_new_rdv(i) \
hs_metrics_update_by_ident(HS_METRICS_NUM_RDV, (i), 0, 1)
+/** New introduction circuit has been established. This is called when the
+ * INTRO_ESTABLISHED has been received by the service. */
+#define hs_metrics_new_established_intro(s) \
+ hs_metrics_update_by_service(HS_METRICS_NUM_ESTABLISHED_INTRO, (s), 0, 1)
+
+/** Established introduction circuit closes. This is called when
+ * INTRO_ESTABLISHED circuit is marked for close. */
+#define hs_metrics_close_established_intro(i) \
+ hs_metrics_update_by_ident(HS_METRICS_NUM_ESTABLISHED_INTRO, (i), 0, 1)
+
#endif /* !defined(TOR_FEATURE_HS_HS_METRICS_H) */