2016-08-03 12:32:26 -07:00
|
|
|
import {BaseException, WrappedException} from '@angular/facade/src/exceptions';
|
2015-05-27 14:57:54 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A metric is measures values
|
|
|
|
*/
|
2015-09-25 14:48:17 -07:00
|
|
|
export abstract class Metric {
|
2016-06-02 17:30:40 -07:00
|
|
|
static bindTo(delegateToken): any[] {
|
|
|
|
return [{provide: Metric, useFactory: (delegate) => delegate, deps: [delegateToken]}];
|
2015-05-27 14:57:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts measuring
|
|
|
|
*/
|
|
|
|
beginMeasure(): Promise<any> { throw new BaseException('NYI'); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ends measuring and reports the data
|
|
|
|
* since the begin call.
|
|
|
|
* @param restart: Whether to restart right after this.
|
|
|
|
*/
|
2015-10-02 16:47:54 -07:00
|
|
|
endMeasure(restart: boolean): Promise<{[key: string]: any}> { throw new BaseException('NYI'); }
|
2015-05-27 14:57:54 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the metrics provided by this metric implementation.
|
|
|
|
* (e.g. units, ...)
|
|
|
|
*/
|
2015-10-02 16:47:54 -07:00
|
|
|
describe(): {[key: string]: any} { throw new BaseException('NYI'); }
|
2015-05-27 14:57:54 -07:00
|
|
|
}
|