UNPKG

@promster/metrics

Version:

Metrics utilities used by all other server integrations

17 lines (16 loc) 783 B
import type { THttpMetrics, TLabelValues, TOptionalPromsterOptions } from '@promster/types'; import { endMeasurementFrom } from "../end-measurement-from/index.js"; import { sortLabels } from "../sort-labels/index.js"; import type { Timing } from "../timing/index.js"; type TRecordingOptions = { labels: TLabelValues; requestContentLength?: number; responseContentLength?: number; }; type TLegacyTiming = [number, number]; export type TRequestRecorder = (_timing: Timing | TLegacyTiming, _recordingOptions: TRecordingOptions) => void; declare const createRequestRecorder: { (metrics: THttpMetrics, options?: TOptionalPromsterOptions): TRequestRecorder; defaultOptions: TOptionalPromsterOptions; }; export { createRequestRecorder, sortLabels, endMeasurementFrom };