diff options
author | Gabriela Moldovan <gabi@torproject.org> | 2023-03-08 17:52:20 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-03-13 11:18:40 -0400 |
commit | 1a60fa547f5c061b1dd4dda4569ddcbb5bf3ad9a (patch) | |
tree | d2eaa1849eab1b8d54ecb072716ab83a0fa68fa7 /src/test | |
parent | d1264d11c3320b8a28c3715acca8a8ace1d70569 (diff) | |
download | tor-1a60fa547f5c061b1dd4dda4569ddcbb5bf3ad9a.tar.gz tor-1a60fa547f5c061b1dd4dda4569ddcbb5bf3ad9a.zip |
metrics: Add HS service side circuit build time metrics.
This adds 2 histogram metrics for hidden services:
* `tor_hs_rend_circ_build_time` - the rendezvous circuit build time in milliseconds
* `tor_hs_intro_circ_build_time` - the introduction circuit build time in milliseconds
The text representation representation of the new metrics looks like this:
```
# HELP tor_hs_rend_circ_build_time The rendezvous circuit build time in milliseconds
# TYPE tor_hs_rend_circ_build_time histogram
tor_hs_rend_circ_build_time_bucket{onion="<elided>",le="1000.00"} 2
tor_hs_rend_circ_build_time_bucket{onion="<elided>",le="5000.00"} 10
tor_hs_rend_circ_build_time_bucket{onion="<elided>",le="10000.00"} 10
tor_hs_rend_circ_build_time_bucket{onion="<elided>",le="30000.00"} 10
tor_hs_rend_circ_build_time_bucket{onion="<elided>",le="60000.00"} 10
tor_hs_rend_circ_build_time_bucket{onion="<elided>",le="+Inf"} 10
tor_hs_rend_circ_build_time_sum{onion="<elided>"} 10824
tor_hs_rend_circ_build_time_count{onion="<elided>"} 10
# HELP tor_hs_intro_circ_build_time The introduction circuit build time in milliseconds
# TYPE tor_hs_intro_circ_build_time histogram
tor_hs_intro_circ_build_time_bucket{onion="<elided>",le="1000.00"} 0
tor_hs_intro_circ_build_time_bucket{onion="<elided>",le="5000.00"} 6
tor_hs_intro_circ_build_time_bucket{onion="<elided>",le="10000.00"} 6
tor_hs_intro_circ_build_time_bucket{onion="<elided>",le="30000.00"} 6
tor_hs_intro_circ_build_time_bucket{onion="<elided>",le="60000.00"} 6
tor_hs_intro_circ_build_time_bucket{onion="<elided>",le="+Inf"} 6
tor_hs_intro_circ_build_time_sum{onion="<elided>"} 9843
tor_hs_intro_circ_build_time_count{onion="<elided>"} 6
```
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_hs_metrics.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_hs_metrics.c b/src/test/test_hs_metrics.c index b7c0ab53da..c3c7ef57bc 100644 --- a/src/test/test_hs_metrics.c +++ b/src/test/test_hs_metrics.c @@ -40,7 +40,7 @@ test_metrics(void *arg) /* Update entry by identifier. */ hs_metrics_update_by_ident(HS_METRICS_NUM_INTRODUCTIONS, - &service->keys.identity_pk, 0, NULL, 42); + &service->keys.identity_pk, 0, NULL, 42, 0); /* Confirm the entry value. */ const smartlist_t *entries = metrics_store_get_all(service->metrics.store, @@ -53,14 +53,14 @@ test_metrics(void *arg) /* Update entry by service now. */ hs_metrics_update_by_service(HS_METRICS_NUM_INTRODUCTIONS, - service, 0, NULL, 42); + service, 0, NULL, 42, 0); tt_int_op(metrics_store_entry_get_value(entry), OP_EQ, 84); const char *reason = HS_METRICS_ERR_INTRO_REQ_BAD_AUTH_KEY; /* Update tor_hs_intro_rejected_intro_req_count */ hs_metrics_update_by_ident(HS_METRICS_NUM_REJECTED_INTRO_REQ, - &service->keys.identity_pk, 0, reason, 112); + &service->keys.identity_pk, 0, reason, 112, 0); entries = metrics_store_get_all(service->metrics.store, "tor_hs_intro_rejected_intro_req_count"); @@ -75,7 +75,7 @@ test_metrics(void *arg) /* Update tor_hs_intro_rejected_intro_req_count entry by service now. */ hs_metrics_update_by_service(HS_METRICS_NUM_REJECTED_INTRO_REQ, service, 0, - reason, 10); + reason, 10, 0); tt_int_op(metrics_store_entry_get_value(entry), OP_EQ, 122); done: |