2016-08-03 15:00:07 -07:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 12:08:49 -07:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2016-08-03 15:00:07 -07:00
|
|
|
*
|
|
|
|
* 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 14:57:54 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A metric is measures values
|
|
|
|
*/
|
2015-09-25 14:48:17 -07:00
|
|
|
export abstract class Metric {
|
2015-05-27 14:57:54 -07:00
|
|
|
/**
|
|
|
|
* Starts measuring
|
|
|
|
*/
|
2020-04-13 16:40:21 -07:00
|
|
|
beginMeasure(): Promise<any> {
|
|
|
|
throw new Error('NYI');
|
|
|
|
}
|
2015-05-27 14:57:54 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ends measuring and reports the data
|
|
|
|
* since the begin call.
|
|
|
|
* @param restart: Whether to restart right after this.
|
|
|
|
*/
|
2020-04-13 16:40:21 -07:00
|
|
|
endMeasure(restart: boolean): Promise<{[key: string]: any}> {
|
|
|
|
throw new Error('NYI');
|
|
|
|
}
|
2015-05-27 14:57:54 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the metrics provided by this metric implementation.
|
|
|
|
* (e.g. units, ...)
|
|
|
|
*/
|
2020-04-13 16:40:21 -07:00
|
|
|
describe(): {[key: string]: string} {
|
|
|
|
throw new Error('NYI');
|
|
|
|
}
|
2015-05-27 14:57:54 -07:00
|
|
|
}
|