import { cdmStatusLevel, cdmLogCode, CdmCorpusContext } from '../../internal';
import { TelemetryClient } from './TelemetryClient';
import { TelemetryConfig } from './TelemetryConfig';
export declare class TelemetryKustoClient implements TelemetryClient {
    /**
     * Maximum number of retries allowed for an HTTP request.
     */
    maxNumRetries: number;
    /**
     * Maximum timeout for completing an HTTP request including retries.
     */
    maxTimeoutMilliseconds: number;
    /**
     * Maximum timeout for a single HTTP request.
     */
    timeoutMilliseconds: number;
    /**
     * The CDM corpus context.
     */
    private ctx;
    /**
     * The Kusto configuration.
     */
    private config;
    /**
     * Indicates whether the telemetry client is enabled or not.
     */
    private isEnabled;
    /**
     * Queuing all log ingestion request to Kusto
     */
    private requestQueue;
    /**
     * The timestamp when the telemetry client is enabled.
     */
    private lastIngestionTime;
    /**
     * An HTTP client for post requests which ingests data into Kusto.
     */
    private readonly httpClient;
    /**
     * Kusto data ingestion command.
     */
    private readonly ingestionCommand;
    /**
     * The frequency in millisecond by which to check and ingest the request queue.
     */
    private readonly ingestionFrequency;
    /**
     * The maximum size of the request queue.
     */
    private readonly requestQueueMaxSize;
    /**
     * The time in millisecond to pause sending http request when throttling.
     */
    private static readonly backoffForThrottling;
    private readonly logExecTimeMethods;
    /**
     * Constructs a telemetry client for ingesting logs into Kusto.
     * @param ctx The CDM corpus context.
     * @param config The configuration for the client.
     */
    constructor(ctx: CdmCorpusContext, config: TelemetryConfig);
    /**
     * Enqueue the request queue with the information to be logged.
     * @param timestamp The log timestamp.
     * @param level Logging status level.
     * @param className Usually the class that is calling the method.
     * @param method Usually denotes method calling this method.
     * @param corpusPath Usually denotes corpus path of document.
     * @param message Informational message.
     * @param requireIngestion (Optional) Whether the log needs to be ingested.
     * @param code (Optional) Error or warning code.
     */
    addToIngestionQueue(timestamp: string, level: cdmStatusLevel, className: string, method: string, corpusPath: string, message: string, requireIngestion?: boolean, code?: cdmLogCode): void;
    /**
     * Check if all the requests have been ingested.
     * @returns A Boolean indicating whether the queue is empty or not.
     */
    checkRequestQueueIsEmpty(): boolean;
    /**
     * Enable the telemetry client which ingests logs into Kusto database.
     */
    enable(): void;
    /**
     * Get an authorization token and send the query to Kusto.
     * @param query The Kusto query command to be posted to the cluster.
     */
    postKustoQuery(query: string): Promise<void>;
    /**
     * A callback function for http request retries.
     * @param response The Http response.
     * @param hasFailed Indicates whether the request has failed.
     * @param retryNumber The number of retries happened.
     * @returns The wait time before starting the next retry.
     */
    private getRetryWaitTime;
    /**
     * Ingest log entries into the table specified.
     * @param logTable The table to be ingested into.
     * @param logEntries Batched log entries.
     */
    private ingestIntoTable;
    /**
     * Ingest all the logs existing in the request queue.
     */
    ingestRequestQueue(): Promise<void>;
    /**
     * Process the input log information to remove all unauthorized information.
     * @param timestamp The log timestamp.
     * @param className Usually the class that is calling the method.
     * @param method Usually denotes method calling this method.
     * @param message Informational message.
     * @param logCode Error code, usually empty.
     * @param corpusPath Usually denotes corpus path of document.
     * @param correlationId The corpus correlation id.
     * @param apiCorrelationId The method correlation id.
     * @param appId The app id assigned by user.
     * @return A complete log entry.
     */
    private processLogEntry;
    /**
     * Serialize the map and return a string.
     * @param map The map object to be serialized.
     * @returns The serialized map.
     */
    private serializeMap;
}
