MCPcopy
hub / github.com/Effect-TS/effect / makePollingGauge

Function makePollingGauge

packages/effect/test/Metric.test.ts:23–27  ·  view source on GitHub ↗
(name: string, increment: number)

Source from the content-addressed store, hash-verified

21const labels = [MetricLabel.make("x", "a"), MetricLabel.make("y", "b")]
22
23const makePollingGauge = (name: string, increment: number) => {
24 const gauge = Metric.gauge(name)
25 const metric = MetricPolling.make(gauge, Metric.value(gauge).pipe(Effect.map((gauge) => gauge.value + increment)))
26 return [gauge, metric] as const
27}
28
29let nameCount = 0
30const nextName = () => `m${++nameCount}`

Callers 1

Metric.test.tsFile · 0.85

Calls 4

makeMethod · 0.65
pipeMethod · 0.65
mapMethod · 0.65
valueMethod · 0.45

Tested by

no test coverage detected