Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

MetricHook

12 exports Since v2.0.0 Source

Constructors

Since v2.0.0

Signature

declare const counter: <A extends number | bigint>(key: MetricKey.MetricKey.Counter<A>) => MetricHook.Counter<A>

Signature

declare const frequency: (_key: MetricKey.MetricKey.Frequency) => MetricHook.Frequency
Since v2.0.0

Signature

declare const gauge: {
(key: Gauge<number>, startAt: number): Gauge<number>;
(key: Gauge<bigint>, startAt: bigint): Gauge<bigint>;
}

Signature

declare const histogram: (key: MetricKey.MetricKey.Histogram) => MetricHook.Histogram
Since v2.0.0

Signature

declare const make: <In, Out>(options: {
readonly get: LazyArg<Out>;
readonly modify: (input: In) => void;
readonly update: (input: In) => void;
}) => MetricHook<In, Out>
Since v2.0.0

Signature

declare const summary: (key: MetricKey.MetricKey.Summary) => MetricHook.Summary

Models

MetricHook

interface
Since v2.0.0

Signature

interface MetricHook<in In, out Out> extends Variance<In, Out>, Pipeable {
get(): Out;
modify(input: In): void;
update(input: In): void;
}

Other

Symbols

Signature

declare const MetricHookTypeId: unique symbol

Signature

type MetricHookTypeId = typeof MetricHookTypeId

Utils

Since v3.6.5

Signature

declare const onModify: {
<In, Out>(f: (input: In) => void): (self: MetricHook<In, Out>) => MetricHook<In, Out>;
<In, Out>(self: MetricHook<In, Out>, f: (input: In) => void): MetricHook<In, Out>;
}
Since v2.0.0

Signature

declare const onUpdate: {
<In, Out>(f: (input: In) => void): (self: MetricHook<In, Out>) => MetricHook<In, Out>;
<In, Out>(self: MetricHook<In, Out>, f: (input: In) => void): MetricHook<In, Out>;
}