import { IMetricsRegistry, Metric, MetricName } from './common'; import { ProxyCreateMessage, ProxyUpdateMessage } from './domain'; import { Environment } from 'pandora-env'; import { MetricsMessengerClient } from './util/MessengerUtil'; import { Proxiable } from './client'; import { AbstractIndicator } from './indicator/AbstractIndicator'; export declare class MetricsClient extends AbstractIndicator { environment: Environment; static getInstance(): MetricsClient; appName: string; allMetricsRegistry: IMetricsRegistry; protected messengerClient: MetricsMessengerClient; clientId: string; group: string; debug: any; static instance: MetricsClient; constructor(); /** * 注册 Client */ protected registerClient(): void; /** * 注册一个 Metric * * @example * let counter = new BaseCounter(); * MetricsClient.register('eagleeye', 'eagleeye.hsf.qps', counter); * counter.inc(2); * * @param {string} group * @param {} name * @param {Proxiable} metric */ register(group: string, name: MetricName | string, metric: Proxiable | Metric | string): Metric; reportMetric(name: MetricName, metric: Metric, group: string): void; /** * 发送上行消息 * @param data */ report(data: ProxyCreateMessage | ProxyUpdateMessage): void; invoke(args: { metricKey; type; }): Promise; /** * 注册下行链路 */ protected registerDownlink(): void; protected getAppName(): any; getCounter(group: string, name: MetricName | string): Metric; getTimer(group: string, name: MetricName | string): Metric; getMeter(group: string, name: MetricName | string): Metric; getHistogram(group: string, name: MetricName | string): Metric; getFastCompass(group: string, name: MetricName | string): Metric; private buildName(name); getNewMetricRegistry(): IMetricsRegistry; private createMetricProxy(type); }