/** * 指标分类 */ import { MetricsManager } from './common/MetricsManager'; export interface IEndPoint { indicators: Array; group: string; initialize(): any; setLogger(logger: any): any; destory(): any; /** * 调用名下指标 * @param args */ invoke(args?: any): any; /** * 处理查询返回结果 */ processQueryResults(results?: Array): any; } /** * 单个指标 */ export interface IIndicator { appName: string; group: string; invoke(data?: any, builder?: IBuilder): any; destory(): any; } /** * 指标构建工具 */ export interface IBuilder { withDetail(key: string, data: any, scope?: IndicatorScope | string): IBuilder; getDetails(): Array; pretty(format: string, value: any): any; setPrettyMode(prettyMode: boolean): any; } /** * builder 构建完单个指标的结果 */ export interface IndicatorBuilderResult { key: string; data: any; scope: IndicatorScope; } /** * Indicator 最后输出的指标 */ export interface IndicatorResultObject { key: string; data: any; scope: IndicatorScope; } /** * Endpoint 中聚合指标的结果 */ export interface IIndicatorResult { setErrorMessage(err: Error): any; setResult(results: Array): any; } export declare type IndicatorType = 'singleton' | 'multiton'; export interface Invokable { invoke(args?: any): any; } export interface LoggerOptions { method: string; from: string; errType: string; message: string; stack: string; } /** * 健康检查状态 */ export declare enum HealthIndicatorStatus { UP = "UP", DOWN = "DOWN", } /** * 指标维度 */ export declare enum IndicatorScope { SYSTEM = "SYSTEM", APP = "APP", PROCESS = "PROCESS", } /** * 指标结果状态 */ export declare enum IndicatorResultStatus { DEFAULT = -1, SUCCESS = 0, FAIL = 1, } /** * 代理创建新 metric 的消息 */ export interface ProxyCreateMessage { action: string; name: string; type: string; group: string; clientId: string; } /** * 代理更新 metric 的消息 */ export interface ProxyUpdateMessage { action: string; name: string; method: string; value: any; type: string; clientId: string; } export interface Reporter { start(intervalInMs?: number): any; stop(): any; } export interface ActuatorResource { prefix: string; aliasPrefix?: Array; route(router: any): any; } export interface ActuatorServer { getMetricsManager(): MetricsManager; getEndPointService(): ActuatorService; } export interface ActuatorService { start(): any; stop(): any; } export interface IPatcher { hook(version: string, reply: () => {}): any; getShimmer(): any; getHook(): any; getTraceManager(): any; getModuleName(): any; run(): any; } export interface LoggerCollector { collect(method: any, reply: (paload: LoggerOptions) => void): any; } export interface SpanData { name: string; references: Array<{ refType: string; traceId: string; spanId: string; }>; context: object; timestamp: number; duration: number; logs: Array<{ timestamp: string; fields: any; }>; tags: object; } export interface TraceData { duration: number; spans: Array; } export interface TracerReport { report(): any; getValue(): any; } export interface Long { /** * Returns the sum of this and the specified Long. */ add(addend: number | Long | string): Long; /** * Returns the bitwise AND of this Long and the specified. */ and(other: Long | number | string): Long; /** * Compares this Long's value with the specified's. */ compare(other: Long | number | string): number; /** * Compares this Long's value with the specified's. */ comp(other: Long | number | string): number; /** * Returns this Long divided by the specified. */ divide(divisor: Long | number | string): Long; /** * Returns this Long divided by the specified. */ div(divisor: Long | number | string): Long; /** * Tests if this Long's value equals the specified's. */ equals(other: Long | number | string): boolean; /** * Tests if this Long's value equals the specified's. */ eq(other: Long | number | string): boolean; /** * Gets the high 32 bits as a signed integer. */ getHighBits(): number; /** * Gets the high 32 bits as an unsigned integer. */ getHighBitsUnsigned(): number; /** * Gets the low 32 bits as a signed integer. */ getLowBits(): number; /** * Gets the low 32 bits as an unsigned integer. */ getLowBitsUnsigned(): number; /** * Gets the number of bits needed to represent the absolute value of this Long. */ getNumBitsAbs(): number; /** * Tests if this Long's value is greater than the specified's. */ greaterThan(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than the specified's. */ gt(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than or equal the specified's. */ greaterThanOrEqual(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than or equal the specified's. */ gte(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than or equal the specified's. */ ge(other: Long | number | string): boolean; /** * Tests if this Long's value is even. */ isEven(): boolean; /** * Tests if this Long's value is negative. */ isNegative(): boolean; /** * Tests if this Long's value is odd. */ isOdd(): boolean; /** * Tests if this Long's value is positive. */ isPositive(): boolean; /** * Tests if this Long's value equals zero. */ isZero(): boolean; /** * Tests if this Long's value equals zero. */ eqz(): boolean; /** * Tests if this Long's value is less than the specified's. */ lessThan(other: Long | number | string): boolean; /** * Tests if this Long's value is less than the specified's. */ lt(other: Long | number | string): boolean; /** * Tests if this Long's value is less than or equal the specified's. */ lessThanOrEqual(other: Long | number | string): boolean; /** * Tests if this Long's value is less than or equal the specified's. */ lte(other: Long | number | string): boolean; /** * Tests if this Long's value is less than or equal the specified's. */ le(other: Long | number | string): boolean; /** * Returns this Long modulo the specified. */ modulo(other: Long | number | string): Long; /** * Returns this Long modulo the specified. */ mod(other: Long | number | string): Long; /** * Returns this Long modulo the specified. */ rem(other: Long | number | string): Long; /** * Returns the product of this and the specified Long. */ multiply(multiplier: Long | number | string): Long; /** * Returns the product of this and the specified Long. */ mul(multiplier: Long | number | string): Long; /** * Negates this Long's value. */ negate(): Long; /** * Negates this Long's value. */ neg(): Long; /** * Returns the bitwise NOT of this Long. */ not(): Long; /** * Tests if this Long's value differs from the specified's. */ notEquals(other: Long | number | string): boolean; /** * Tests if this Long's value differs from the specified's. */ neq(other: Long | number | string): boolean; /** * Tests if this Long's value differs from the specified's. */ ne(other: Long | number | string): boolean; /** * Returns the bitwise OR of this Long and the specified. */ or(other: Long | number | string): Long; /** * Returns this Long with bits shifted to the left by the given amount. */ shiftLeft(numBits: number | Long): Long; /** * Returns this Long with bits shifted to the left by the given amount. */ shl(numBits: number | Long): Long; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. */ shiftRight(numBits: number | Long): Long; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. */ shr(numBits: number | Long): Long; /** * Returns this Long with bits logically shifted to the right by the given amount. */ shiftRightUnsigned(numBits: number | Long): Long; /** * Returns this Long with bits logically shifted to the right by the given amount. */ shru(numBits: number | Long): Long; /** * Returns this Long with bits logically shifted to the right by the given amount. */ shr_u(numBits: number | Long): Long; /** * Returns the difference of this and the specified Long. */ subtract(subtrahend: number | Long | string): Long; /** * Returns the difference of this and the specified Long. */ sub(subtrahend: number | Long | string): Long; /** * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ toInt(): number; /** * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ toNumber(): number; /** * Converts this Long to its byte representation. */ toBytes(le?: boolean): number[]; /** * Converts this Long to its little endian byte representation. */ toBytesLE(): number[]; /** * Converts this Long to its big endian byte representation. */ toBytesBE(): number[]; /** * Converts this Long to signed. */ toSigned(): Long; /** * Converts the Long to a string written in the specified radix. */ toString(radix?: number): string; /** * Converts this Long to unsigned. */ toUnsigned(): Long; /** * Returns the bitwise XOR of this Long and the given one. */ xor(other: Long | number | string): Long; }