mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
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:
parent
deeb963d7e
commit
f8461b8989
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user