mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 01:01:04 +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
@@ -51,18 +51,18 @@ const ACTIVE_LEAVES_SMALLVEC_CAPACITY: usize = 8;
|
||||
/// Note that the activated and deactivated fields indicate deltas, not complete sets.
|
||||
#[derive(Clone, Default)]
|
||||
pub struct ActiveLeavesUpdate {
|
||||
/// New relay chain block hashes of interest and their associated [`JaegerSpan`].
|
||||
/// New relay chain block hashes of interest and their associated [`jaeger::Span`].
|
||||
///
|
||||
/// NOTE: Each span should only be kept active as long as the leaf is considered active and should be dropped
|
||||
/// when the leaf is deactivated.
|
||||
pub activated: SmallVec<[(Hash, Arc<JaegerSpan>); ACTIVE_LEAVES_SMALLVEC_CAPACITY]>,
|
||||
pub activated: SmallVec<[(Hash, Arc<jaeger::Span>); ACTIVE_LEAVES_SMALLVEC_CAPACITY]>,
|
||||
/// Relay chain block hashes no longer of interest.
|
||||
pub deactivated: SmallVec<[Hash; ACTIVE_LEAVES_SMALLVEC_CAPACITY]>,
|
||||
}
|
||||
|
||||
impl ActiveLeavesUpdate {
|
||||
/// Create a ActiveLeavesUpdate with a single activated hash
|
||||
pub fn start_work(hash: Hash, span: Arc<JaegerSpan>) -> Self {
|
||||
pub fn start_work(hash: Hash, span: Arc<jaeger::Span>) -> Self {
|
||||
Self { activated: [(hash, span)][..].into(), ..Default::default() }
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ impl PartialEq for ActiveLeavesUpdate {
|
||||
|
||||
impl fmt::Debug for ActiveLeavesUpdate {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
struct Activated<'a>(&'a [(Hash, Arc<JaegerSpan>)]);
|
||||
struct Activated<'a>(&'a [(Hash, Arc<jaeger::Span>)]);
|
||||
impl fmt::Debug for Activated<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_list().entries(self.0.iter().map(|e| e.0)).finish()
|
||||
|
||||
Reference in New Issue
Block a user