export interface IMetrics { nodes?: Array<{ node: string; timestamp: number; }>; compiler?: string; compilerVersion?: string; [key: string]: any; } /** * Push event node to metrics. * * Side-effected, shall mutate the `nodes` field in `metrics` object. * @param metrics * @param event */ export declare function addNodeToMetrics(metrics: IMetrics, event: string): void; /** * Add field with to metrics. * * Side-effected, shall mutate the `metrics` object. * @param metrics * @param field * @param value */ export declare function addFieldToMetrics(metrics: IMetrics, field: string, value: any): void; /** * Merge a list of metrics, return a new metric. * * Non-side-effected. * @param metrics * @returns */ export declare function mergeMetrics(...metrics: IMetrics[]): IMetrics; /** * Abstract for {@link IMetrics} */ export declare class Metrics { nodes: IMetrics['nodes']; tags: Exclude; /** * Add node to {@link nodes} * @param event * @param timestamp */ addNode(event: string, timestamp?: number): this; /** * Add node to {@link tags} * @param field * @param value */ updateField(field: string, value: keyof Exclude): this; /** * Merge metrics, the order matters */ merge(...others: IMetrics[]): this; /** * Settle the metrics * @param clear whether to reset the metrics to empty. * @returns */ settle(clear?: boolean): IMetrics; /** * Clear the metrics. */ clear(): this; }