2016-08-03 18:00:07 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2015-05-27 17:57:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A metric is measures values
|
|
|
|
*/
|
2015-09-25 17:48:17 -04:00
|
|
|
export abstract class Metric {
|
2015-05-27 17:57:54 -04:00
|
|
|
/**
|
|
|
|
* Starts measuring
|
|
|
|
*/
|
2016-08-25 03:50:16 -04:00
|
|
|
beginMeasure(): Promise<any> { throw new Error('NYI'); }
|
2015-05-27 17:57:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ends measuring and reports the data
|
|
|
|
* since the begin call.
|
|
|
|
* @param restart: Whether to restart right after this.
|
|
|
|
*/
|
2016-08-25 03:50:16 -04:00
|
|
|
endMeasure(restart: boolean): Promise<{[key: string]: any}> { throw new Error('NYI'); }
|
2015-05-27 17:57:54 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the metrics provided by this metric implementation.
|
|
|
|
* (e.g. units, ...)
|
|
|
|
*/
|
2016-08-26 19:34:08 -04:00
|
|
|
describe(): {[key: string]: string} { throw new Error('NYI'); }
|
2015-05-27 17:57:54 -04:00
|
|
|
}
|