MCPcopy Index your code
hub / github.com/DoNewsCode/core / Example

Function Example

observability/example_test.go:12–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10)
11
12func Example() {
13 c := core.New()
14 c.ProvideEssentials()
15 c.Provide(observability.Providers())
16 c.Invoke(func(tracer opentracing.Tracer, metrics *srvhttp.RequestDurationSeconds) {
17 start := time.Now()
18 span := tracer.StartSpan("test")
19 time.Sleep(time.Second)
20 span.Finish()
21 metrics.
22 Module("module").
23 Service("service").
24 Route("route").
25 Observe(time.Since(start))
26 })
27}

Callers

nothing calls this directly

Calls 9

NewFunction · 0.92
ProvidersFunction · 0.92
ProvideEssentialsMethod · 0.80
ProvideMethod · 0.80
InvokeMethod · 0.80
RouteMethod · 0.65
ModuleMethod · 0.65
ObserveMethod · 0.45
ServiceMethod · 0.45

Tested by

no test coverage detected