UNPKG

pandora-metrics

Version:
29 lines (28 loc) 1.05 kB
import { IReservoir, ReservoirType } from '../Reservoir'; import { BucketCounter } from './BucketCounter'; import { Counting, Metric, Sampling, Snapshot } from '../domain'; /** * A metric which calculates the distribution of a value. * 直方分布指标,例如,可以用于统计某个接口的响应时间,可以展示50%, 70%, 90%的请求响应时间落在哪个区间内 * * @see <a href="http://www.johndcook.com/standard_deviation.html">Accurately computing running * variance</a> */ export interface IHistogram extends Metric, Sampling, Counting { /** * Adds a recorded value. * 将某个整型值添加到 * * @param value the length of the value */ update(value: number): any; } export declare class BaseHistogram implements IHistogram { reservoir: IReservoir; type: string; count: BucketCounter; constructor(type?: ReservoirType | IReservoir, interval?: number, numberOfBucket?: number); update(value: number): void; getCount(): number; getSnapshot(): Snapshot; }