mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
feat/jaeger: more spans, more stages (#2477)
* feat/jaeger: more spans, more stages Stage numbers are still arbitrarily picked. * feat/jaeger: additional spans * chore/spellcheck: improve the dictionary * fix/jaeger JaegerSpan -> jaeger::Span
This commit is contained in:
committed by
GitHub
parent
a5defa7c7f
commit
49c6aa9a76
@@ -25,7 +25,7 @@ use std::{fmt, collections::HashMap};
|
||||
|
||||
pub use sc_network::PeerId;
|
||||
#[doc(hidden)]
|
||||
pub use polkadot_node_jaeger::JaegerSpan;
|
||||
pub use polkadot_node_jaeger as jaeger;
|
||||
#[doc(hidden)]
|
||||
pub use std::sync::Arc;
|
||||
|
||||
@@ -118,16 +118,16 @@ macro_rules! impl_try_from {
|
||||
|
||||
/// Specialized wrapper around [`View`].
|
||||
///
|
||||
/// Besides the access to the view itself, it also gives access to the [`JaegerSpan`] per leave/head.
|
||||
/// Besides the access to the view itself, it also gives access to the [`jaeger::Span`] per leave/head.
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct OurView {
|
||||
view: View,
|
||||
span_per_head: HashMap<Hash, Arc<JaegerSpan>>,
|
||||
span_per_head: HashMap<Hash, Arc<jaeger::Span>>,
|
||||
}
|
||||
|
||||
impl OurView {
|
||||
/// Creates a new instance.
|
||||
pub fn new(heads: impl IntoIterator<Item = (Hash, Arc<JaegerSpan>)>, finalized_number: BlockNumber) -> Self {
|
||||
pub fn new(heads: impl IntoIterator<Item = (Hash, Arc<jaeger::Span>)>, finalized_number: BlockNumber) -> Self {
|
||||
let state_per_head = heads.into_iter().collect::<HashMap<_, _>>();
|
||||
|
||||
Self {
|
||||
@@ -142,7 +142,7 @@ impl OurView {
|
||||
/// Returns the span per head map.
|
||||
///
|
||||
/// For each head there exists one span in this map.
|
||||
pub fn span_per_head(&self) -> &HashMap<Hash, Arc<JaegerSpan>> {
|
||||
pub fn span_per_head(&self) -> &HashMap<Hash, Arc<jaeger::Span>> {
|
||||
&self.span_per_head
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ impl std::ops::Deref for OurView {
|
||||
}
|
||||
}
|
||||
|
||||
/// Construct a new [`OurView`] with the given chain heads, finalized number 0 and disabled [`JaegerSpan`]'s.
|
||||
/// Construct a new [`OurView`] with the given chain heads, finalized number 0 and disabled [`jaeger::Span`]'s.
|
||||
///
|
||||
/// NOTE: Use for tests only.
|
||||
///
|
||||
@@ -176,7 +176,7 @@ impl std::ops::Deref for OurView {
|
||||
macro_rules! our_view {
|
||||
( $( $hash:expr ),* $(,)? ) => {
|
||||
$crate::OurView::new(
|
||||
vec![ $( $hash.clone() ),* ].into_iter().map(|h| (h, $crate::Arc::new($crate::JaegerSpan::Disabled))),
|
||||
vec![ $( $hash.clone() ),* ].into_iter().map(|h| (h, $crate::Arc::new($crate::jaeger::Span::Disabled))),
|
||||
0,
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user