-
Notifications
You must be signed in to change notification settings - Fork 0
/
Counter.ts
36 lines (34 loc) · 1018 Bytes
/
Counter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** @module count */
import { CounterType } from './CounterType';
/**
* Data object to store measurement for a performance counter.
* This object is used by [[CachedCounters]] to store counters.
*/
export class Counter {
/** The counter unique name */
public name: string;
/** The counter type that defines measurement algorithm */
public type: CounterType;
/** The last recorded value */
public last: number;
/** The total count */
public count: number;
/** The minimum value */
public min: number;
/** The maximum value */
public max: number;
/** The average value */
public average: number;
/** The recorded timestamp */
public time: Date;
/**
* Creates a instance of the data obejct
*
* @param name a counter name.
* @param type a counter type.
*/
public constructor(name: string, type: CounterType) {
this.name = name;
this.type = type;
}
}