MCPcopy Create free account
hub / github.com/Effect-TS/effect / timer

Function timer

packages/effect/src/internal/metric.ts:342–354  ·  view source on GitHub ↗
(name: string, description?: string)

Source from the content-addressed store, hash-verified

340
341/** @internal */
342export const timer = (name: string, description?: string): Metric.Metric<
343 MetricKeyType.MetricKeyType.Histogram,
344 Duration.Duration,
345 MetricState.MetricState.Histogram
346> => {
347 const boundaries = metricBoundaries.exponential({
348 start: 0.5,
349 factor: 2,
350 count: 35
351 })
352 const base = pipe(histogram(name, boundaries, description), tagged("time_unit", "milliseconds"))
353 return mapInput(base, Duration.toMillis)
354}
355
356/** @internal */
357export const timerWithBoundaries = (

Callers

nothing calls this directly

Calls 3

pipeFunction · 0.70
histogramFunction · 0.70
taggedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…