mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 16:11:08 +00:00
update mick jaeger and add some sanity unit tests (#5067)
* test: verify identifier generation is correct in jaeger * bump mick jaeger to 0.1.8 Fixes the trace endianness issue. * more docs, extra traceID field for CandidateHash as extra tag * chore: spellcheck * fix assert statement
This commit is contained in:
committed by
GitHub
parent
3a11be1683
commit
9369dd3384
@@ -92,6 +92,21 @@ impl Jaeger {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Provide a no-thrills test setup helper.
|
||||
#[cfg(test)]
|
||||
pub fn test_setup() {
|
||||
let mut instance = INSTANCE.write();
|
||||
match *instance {
|
||||
Self::Launched { .. } => {},
|
||||
_ => {
|
||||
let (traces_in, _traces_out) = mick_jaeger::init(mick_jaeger::Config {
|
||||
service_name: "polkadot-jaeger-test".to_owned(),
|
||||
});
|
||||
*instance = Self::Launched { traces_in };
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// Spawn the background task in order to send the tracing information out via UDP
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
pub fn launch<S: SpawnNamed>(self, spawner: S) -> result::Result<(), JaegerError> {
|
||||
@@ -133,6 +148,10 @@ impl Jaeger {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Create a span, but defer the evaluation/transformation into a `TraceIdentifier`.
|
||||
///
|
||||
/// The deferral allows to avoid the additional CPU runtime cost in case of
|
||||
/// items that are not a pre-computed hash by themselves.
|
||||
pub(crate) fn span<F>(&self, lazy_hash: F, span_name: &'static str) -> Option<mick_jaeger::Span>
|
||||
where
|
||||
F: Fn() -> TraceIdentifier,
|
||||
|
||||
Reference in New Issue
Block a user