UNPKG

855 BPlain TextView Raw
1import {bind, provide, Provider} from 'angular2/src/core/di';
2import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
3
4/**
5 * A metric is measures values
6 */
7export abstract class Metric {
8 static bindTo(delegateToken): Provider[] {
9 return [bind(Metric).toFactory((delegate) => delegate, [delegateToken])];
10 }
11
12 /**
13 * Starts measuring
14 */
15 beginMeasure(): Promise<any> { throw new BaseException('NYI'); }
16
17 /**
18 * Ends measuring and reports the data
19 * since the begin call.
20 * @param restart: Whether to restart right after this.
21 */
22 endMeasure(restart: boolean): Promise<{[key: string]: any}> { throw new BaseException('NYI'); }
23
24 /**
25 * Describes the metrics provided by this metric implementation.
26 * (e.g. units, ...)
27 */
28 describe(): {[key: string]: any} { throw new BaseException('NYI'); }
29}