MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / instance

Method instance

crates/instrument-hooks-bindings/src/lib.rs:30–40  ·  view source on GitHub ↗
(integration: &str, version: &str)

Source from the content-addressed store, hash-verified

28 /// Returns a singleton instance of `InstrumentHooks`.
29 #[inline(always)]
30 pub fn instance(integration: &str, version: &str) -> &'static Self {
31 static INSTANCE: OnceLock<InstrumentHooks> = OnceLock::new();
32 INSTANCE.get_or_init(|| {
33 let instance =
34 InstrumentHooks::new().expect("Failed to initialize InstrumentHooks");
35 instance
36 .set_integration(integration, version)
37 .expect("Failed to set integration");
38 instance
39 })
40 }
41
42 #[inline(always)]
43 pub fn is_instrumented(&self) -> bool {

Callers

nothing calls this directly

Calls 1

set_integrationMethod · 0.45

Tested by

no test coverage detected