Skip to main content Link Search Menu Expand Document (external link)

MetricHook overview

Added in v2.0.0


Table of contents


constructors

counter

Signature

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

Added in v2.0.0

frequency

Signature

export declare const frequency: (_key: MetricKey.MetricKey.Frequency) => MetricHook.Frequency

Added in v2.0.0

gauge

Signature

export declare const gauge: {
  (key: MetricKey.MetricKey.Gauge<number>, startAt: number): MetricHook.Gauge<number>
  (key: MetricKey.MetricKey.Gauge<bigint>, startAt: bigint): MetricHook.Gauge<bigint>
}

Added in v2.0.0

histogram

Signature

export declare const histogram: (key: MetricKey.MetricKey.Histogram) => MetricHook.Histogram

Added in v2.0.0

make

Signature

export declare const make: <In, Out>(options: {
  readonly get: LazyArg<Out>
  readonly update: (input: In) => void
  readonly modify: (input: In) => void
}) => MetricHook<In, Out>

Added in v2.0.0

summary

Signature

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

Added in v2.0.0

models

MetricHook (interface)

Signature

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

Added in v2.0.0

symbols

MetricHookTypeId

Signature

export declare const MetricHookTypeId: typeof MetricHookTypeId

Added in v2.0.0

MetricHookTypeId (type alias)

Signature

export type MetricHookTypeId = typeof MetricHookTypeId

Added in v2.0.0

utils

MetricHook (namespace)

Added in v2.0.0

Variance (interface)

Signature

export interface Variance<in In, out Out> {
  readonly [MetricHookTypeId]: {
    readonly _In: Types.Contravariant<In>
    readonly _Out: Types.Covariant<Out>
  }
}

Added in v2.0.0

Counter (type alias)

Signature

export type Counter<A extends number | bigint> = MetricHook<A, MetricState.MetricState.Counter<A>>

Added in v2.0.0

Frequency (type alias)

Signature

export type Frequency = MetricHook<string, MetricState.MetricState.Frequency>

Added in v2.0.0

Gauge (type alias)

Signature

export type Gauge<A extends number | bigint> = MetricHook<A, MetricState.MetricState.Gauge<A>>

Added in v2.0.0

Histogram (type alias)

Signature

export type Histogram = MetricHook<number, MetricState.MetricState.Histogram>

Added in v2.0.0

Root (type alias)

Signature

export type Root = MetricHook<any, MetricState.MetricState.Untyped>

Added in v2.0.0

Summary (type alias)

Signature

export type Summary = MetricHook<readonly [number, number], MetricState.MetricState.Summary>

Added in v2.0.0

Untyped (type alias)

Signature

export type Untyped = MetricHook<any, any>

Added in v2.0.0

onModify

Signature

export 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>
}

Added in v3.6.5

onUpdate

Signature

export 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>
}

Added in v2.0.0