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
This commit is contained in:
Stefan Filip 2021-01-21 11:27:08 -08:00 committed by Facebook GitHub Bot
parent deeb963d7e
commit f8461b8989
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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);