1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Measure RPC latency after connection lock is taken

This commit is contained in:
Roman Zeyde 2018-07-28 11:37:15 +03:00
parent 1d59449677
commit defe9f13af
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

View File

@ -292,8 +292,8 @@ impl Daemon {
}
fn call_jsonrpc(&self, method: &str, request: &Value) -> Result<Value> {
let timer = self.latency.with_label_values(&[method]).start_timer();
let mut conn = self.conn.lock().unwrap();
let timer = self.latency.with_label_values(&[method]).start_timer();
let request = request.to_string();
conn.send(&request)?;
self.size