mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Improve Network Spans (#2169)
* utility functions for erasure-coding threshold * add candidate-hash tag to candidate jaeger spans * debug implementation for jaeger span * add a span to each live candidate in availability dist. * availability span covers only our piece * fix tests * keep span alive slightly longer * remove spammy bitfield-gossip-received log * Revert "remove spammy bitfield-gossip-received log" This reverts commit 831a2db506d66f64ea516af3caf891e8643f5c43. * add claimed validator to bitfield-gossip span * add peer-id to handle-incoming span * add peer-id to availability distribution span * Update node/network/availability-distribution/src/lib.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Update erasure-coding/src/lib.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Update node/subsystem/src/jaeger.rs Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
This commit is contained in:
committed by
GitHub
parent
a864eaa093
commit
41102a6ff9
@@ -129,6 +129,12 @@ impl JaegerSpan {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for JaegerSpan {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "<jaeger span>")
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Option<mick_jaeger::Span>> for JaegerSpan {
|
||||
fn from(src: Option<mick_jaeger::Span>) -> Self {
|
||||
if let Some(span) = src {
|
||||
@@ -146,9 +152,12 @@ impl From<mick_jaeger::Span> for JaegerSpan {
|
||||
}
|
||||
|
||||
/// Shortcut for [`candidate_hash_span`] with the hash of the `Candidate` block.
|
||||
#[inline(always)]
|
||||
pub fn candidate_hash_span(candidate_hash: &CandidateHash, span_name: impl Into<String>) -> JaegerSpan {
|
||||
INSTANCE.read_recursive().span(|| { candidate_hash.0 }, span_name).into()
|
||||
let mut span: JaegerSpan = INSTANCE.read_recursive()
|
||||
.span(|| { candidate_hash.0 }, span_name).into();
|
||||
|
||||
span.add_string_tag("candidate-hash", &format!("{:?}", candidate_hash.0));
|
||||
span
|
||||
}
|
||||
|
||||
/// Shortcut for [`hash_span`] with the hash of the `PoV`.
|
||||
|
||||
Reference in New Issue
Block a user