From f8461b8989b2929c23ecf8ff3c366fd1d97dd18d Mon Sep 17 00:00:00 2001 From: Stefan Filip Date: Thu, 21 Jan 2021 11:27:08 -0800 Subject: [PATCH] metrics: use dot `.` as metric separator Summary: Dot `.` is the common separator for the metrics aggregator that we use. This adds some form of consistency. Reviewed By: DurhamG Differential Revision: D25968398 fbshipit-source-id: 194d2f33fe477fe5d768a9cd8f9f46f56445e3e8 --- eden/scm/edenscm/mercurial/dispatch.py | 2 +- eden/scm/lib/hg-http/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eden/scm/edenscm/mercurial/dispatch.py b/eden/scm/edenscm/mercurial/dispatch.py index cc360c6ad6..dc1c47bab0 100644 --- a/eden/scm/edenscm/mercurial/dispatch.py +++ b/eden/scm/edenscm/mercurial/dispatch.py @@ -431,7 +431,7 @@ def dispatch(req): # Re-arrange metrics so "a_b_c", "a_b_d", "a_c" becomes # {'a': {'b': {'c': ..., 'd': ...}, 'c': ...} metrics = {} - splitre = re.compile("_|/") + splitre = re.compile(r"_|/|\.") for key, value in hgmetrics.items(): cur = metrics names = splitre.split(key) diff --git a/eden/scm/lib/hg-http/src/lib.rs b/eden/scm/lib/hg-http/src/lib.rs index 1426b0753a..8e7db2b064 100644 --- a/eden/scm/lib/hg-http/src/lib.rs +++ b/eden/scm/lib/hg-http/src/lib.rs @@ -21,7 +21,7 @@ pub fn http_client(client_id: impl ToString) -> HttpClient { } fn bump_counters(client_id: &str, stats: &Stats) { - let n = |suffix: &'static str| -> String { format!("http/{}/{}", client_id, suffix) }; + let n = |suffix: &'static str| -> String { format!("http.{}.{}", client_id, suffix) }; // TODO: gauges: rx_bytes and tx_bytes; histograms: request_time_ms, response_delay_ms increment_counter(n("total_rx_bytes"), stats.downloaded); increment_counter(n("total_tx_bytes"), stats.uploaded);