summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_circuit.c
diff options
context:
space:
mode:
authorMicah Elizabeth Scott <beth@torproject.org>2023-02-24 18:25:25 -0800
committerMicah Elizabeth Scott <beth@torproject.org>2023-05-10 07:38:28 -0700
commit48c67263d9b3779e1f3296564192b13b6b0895b4 (patch)
tree79808b8e059916a49a6e2619f02a641a7fe1d4a3 /src/feature/hs/hs_circuit.c
parent09afc5eacf67d83cd75b3a659fc23a6120e0033e (diff)
downloadtor-48c67263d9b3779e1f3296564192b13b6b0895b4.tar.gz
tor-48c67263d9b3779e1f3296564192b13b6b0895b4.zip
hs_metrics: Proof of Work pqueue depth, suggested effort
Adds two new metrics for hs_pow, and an internal parameter within hs_metrics for implementing gauge parameters that reset before every update. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r--src/feature/hs/hs_circuit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index 0ac47ee19f..3684def697 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -791,6 +791,9 @@ handle_rend_pqueue_cb(mainloop_event_t *ev, void *arg)
compare_rend_request_by_effort_,
offsetof(pending_rend_t, idx));
+ hs_metrics_pow_pqueue_rdv(service,
+ smartlist_len(pow_state->rend_request_pqueue));
+
log_notice(LD_REND, "Dequeued pending rendezvous request with effort: %u. "
"Waited %d. "
"Remaining requests: %u",
@@ -870,6 +873,9 @@ enqueue_rend_request(const hs_service_t *service, hs_service_intro_point_t *ip,
compare_rend_request_by_effort_,
offsetof(pending_rend_t, idx), req);
+ hs_metrics_pow_pqueue_rdv(service,
+ smartlist_len(pow_state->rend_request_pqueue));
+
log_notice(LD_REND, "Enqueued rendezvous request with effort: %u. "
"Queued requests: %u",
req->rdv_data.pow_effort,
@@ -888,6 +894,8 @@ enqueue_rend_request(const hs_service_t *service, hs_service_intro_point_t *ip,
if (smartlist_len(pow_state->rend_request_pqueue) >=
QUEUED_REND_REQUEST_HIGH_WATER) {
trim_rend_pqueue(pow_state, now);
+ hs_metrics_pow_pqueue_rdv(service,
+ smartlist_len(pow_state->rend_request_pqueue));
}
return 0;