import { HoistService, InitContext, MetricTags } from '@xh/hoist/core'; /** * Lightweight client-side metrics service. Records timers and counters by name and optional tags, * batching to the server where they are registered with the Micrometer registry on hoist-core. * * Apps should generally use the {@link Runner} `counter()` / `timer()` builder methods instead of * calling this service directly. */ export declare class MetricsService extends HoistService { telemetryPrefix: string; static instance: MetricsService; /** Max entries to retain when pushes are failing - oldest are dropped beyond this. */ private static MAX_PENDING; private pending; initAsync(ctx: InitContext): Promise; /** Record a timer measurement (elapsed millis) for the named metric. */ recordTimer(name: string, valueMs: number, tags?: MetricTags): void; /** Increment a counter for the named metric (defaults to +1). */ recordCount(name: string, value?: number, tags?: MetricTags): void; /** * Flush the queue of pending metric entries to the server. * @internal - apps should generally allow this service to manage w/its internal debounce. */ pushPendingAsync(): Promise; private queue; /** Bound the pending buffer, silently dropping oldest entries (failed pushes are logged). */ private enforceCap; private pushPendingBuffered; }