import { DurationMetricRecorder } from "./duration-metric-recorder"; import { ConnectRecorderMetricParams, MetricOptions } from "./metric-types"; /** * @classdesc ConnectMetricRecorder class provides APIs to emit metrics based on users' need */ export declare class ConnectMetricRecorder { private readonly namespace; private provider; private readonly providerFactory; private _proxy; private readonly globalDimensions; private readonly globalDimensionProvider?; /** * Constructor for ConnectMetricRecorder * @param {ConnectRecorderMetricParams} params - The namespace and provider(optional) */ constructor(params: ConnectRecorderMetricParams); /** * Emit a metric that counts success * @param {string} metricName - The name of the metric * @param {Record} dimensions - The dimensions of a metric with keys and values (optional) * @param {Record} optionalDimensions - The optional dimensions of a metric with keys and values (optional) */ recordSuccess(metricName: string, metricOptions?: MetricOptions): void; /** * Emit a metric that counts error. Add default dimension { name: "Metric", value: "Error" } to the metric if not added * @param {string} metricName - The name of the metric * @param {Record} dimensions - The dimensions of a metric with keys and values (optional) * @param {Record} optionalDimensions - The optional dimensions of a metric with keys and values (optional) */ recordError(metricName: string, metricOptions?: MetricOptions): void; /** * Emit a counting metric * @param {string} metricName - The name of the metric * @param {number} count - The count of the metric * @param {Record} dimensions - The dimensions of a metric with keys and values (optional) * @param {Record} optionalDimensions - The optional dimensions of a metric with keys and values (optional) */ recordCount(metricName: string, count: number, metricOptions?: MetricOptions): void; /** * Start a duration metric * @param {string} metricName - The name of the metric * @param {Record} dimensions - The dimensions of a metric with keys and values (optional) * @param {Record} optionalDimensions - The optional dimensions of a metric with keys and values (optional) * @returns {DurationMetricRecorder} - The DurationMetricRecorder object being created */ startDurationCounter(metricName: string, metricOptions?: MetricOptions): DurationMetricRecorder; /** * Emit metric * @param {string} metricName - The name of the metric * @param {unit} unit - The unit of the metric * @param {number} value - The value of the metric * @param {Record} dimensions - The dimensions of a metric with keys and values (optional) * @param {Record} optionalDimensions - The optional dimensions of a metric with keys and values (optional) */ private sendMetric; /** * Get the provider of the ConnectMetricRecorder instance */ private getProvider; /** * Get the proxy of the ConnectMetricRecorder instance */ private getProxy; } //# sourceMappingURL=connect-metric-recorder.d.ts.map