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

Function snapshotUnsafe

packages/effect/src/Metric.ts:3065–3071  ·  view source on GitHub ↗
(context: Context.Context<never>)

Source from the content-addressed store, hash-verified

3063 * @since 4.0.0
3064 */
3065export const snapshotUnsafe = (context: Context.Context<never>): ReadonlyArray<Metric.Snapshot> => {
3066 const registry = Context.get(context, MetricRegistry)
3067 return Array.from(registry.values()).map(({ hooks, ...meta }) => ({
3068 ...meta,
3069 state: hooks.get(context)
3070 }))
3071}
3072
3073const renderName = (metric: Metric.Snapshot, padTo: number): string => `name=${metric.id.padEnd(padTo, " ")}`
3074

Callers 1

Metric.tsFile · 0.85

Calls 2

getMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected