mirror of
https://github.com/romanz/electrs.git
synced 2024-11-19 01:43:29 +01:00
Trace Prometheus' metrics requests
This commit is contained in:
parent
82c3ce270e
commit
c51aac74f7
@ -90,6 +90,7 @@ fn handle_request(
|
|||||||
prometheus::TextEncoder::new()
|
prometheus::TextEncoder::new()
|
||||||
.encode(®.gather(), &mut buffer)
|
.encode(®.gather(), &mut buffer)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
trace!("metrics: {:?} -> {} bytes", request, buffer.len());
|
||||||
let response = tiny_http::Response::from_data(buffer);
|
let response = tiny_http::Response::from_data(buffer);
|
||||||
request.respond(response)
|
request.respond(response)
|
||||||
}
|
}
|
||||||
|
@ -585,7 +585,10 @@ fn handle_request(
|
|||||||
};
|
};
|
||||||
let proof = query.get_merkle_proof(&hash, &status.block_hash.unwrap())?;
|
let proof = query.get_merkle_proof(&hash, &status.block_hash.unwrap())?;
|
||||||
let ttl = ttl_by_depth(status.block_height, query);
|
let ttl = ttl_by_depth(status.block_height, query);
|
||||||
json_response(json!({ "block_height": status.block_height, "merkle": proof.0, "pos": proof.1 }), ttl)
|
json_response(
|
||||||
|
json!({ "block_height": status.block_height, "merkle": proof.0, "pos": proof.1 }),
|
||||||
|
ttl,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
(&Method::GET, Some(&"tx"), Some(hash), Some(&"outspend"), Some(index)) => {
|
(&Method::GET, Some(&"tx"), Some(hash), Some(&"outspend"), Some(index)) => {
|
||||||
let hash = Sha256dHash::from_hex(hash)?;
|
let hash = Sha256dHash::from_hex(hash)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user