/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { ITelemetryGenericEventExt, TelemetryLoggerExt } from "./telemetryTypesUndeprecated.js"; /** * Telemetry class that accumulates measurements which are eventually logged in a telemetry event through the provided * {@link TelemetryEventBatcher.logger | logger} when the number of calls to the function reaches the specified {@link TelemetryEventBatcher.threshold | threshold}. * * @remarks It is expected to be used for a single event type. If different properties should be logged at different times, a separate `TelemetryEventBatcher` should be created with separate `TMetrics` type. * @typeparam TMetrics - The set of keys that should be logged. * E.g., `keyof Foo` for logging properties `bar` and `baz` from `type Foo = { bar: number, baz: number }`. * * @sealed * @internal */ export declare class TelemetryEventBatcher { /** * Custom properties to include in the telemetry performance event when it is written. */ private readonly eventBase; /** * The logger to use to write the telemetry performance event. */ private readonly logger; /** * The number of logs to accumulate before sending the data to the logger. */ private readonly threshold; /** * Stores the sum of the custom data passed into the logger. */ private dataSums; /** * Stores the maximum value of the custom data passed into the logger. */ private dataMaxes; /** * Counter to keep track of the number of times the log function is called. */ private counter; constructor( /** * Custom properties to include in the telemetry performance event when it is written. */ eventBase: ITelemetryGenericEventExt, /** * The logger to use to write the telemetry performance event. */ logger: TelemetryLoggerExt, /** * The number of logs to accumulate before sending the data to the logger. */ threshold: number); /** * Accumulates the custom data and sends it to the logger every {@link TelemetryEventBatcher.threshold} calls. * * @param customData - A record storing the custom data to be accumulated and eventually logged. */ accumulateAndLog(customData: Record): void; private sendData; } //# sourceMappingURL=telemetryEventBatcher.d.ts.map