@ -42,7 +42,7 @@ export class MultiMetric extends Metric {
|
||||
}
|
||||
}
|
||||
|
||||
function mergeStringMaps(maps: any[]): Object {
|
||||
function mergeStringMaps(maps: { [key: string]: string }[]): Object {
|
||||
var result = {};
|
||||
maps.forEach(
|
||||
map => { StringMapWrapper.forEach(map, (value, prop) => { result[prop] = value; }); });
|
||||
|
@ -142,7 +142,7 @@ export class PerflogMetric extends Metric {
|
||||
});
|
||||
}
|
||||
|
||||
_addEvents(events: any[]) {
|
||||
_addEvents(events: { [key: string]: string }[]) {
|
||||
var needSort = false;
|
||||
events.forEach(event => {
|
||||
if (StringWrapper.equals(event['ph'], 'X')) {
|
||||
|
@ -5,14 +5,14 @@ export class Statistic {
|
||||
return Statistic.calculateStandardDeviation(sample, mean) / mean * 100;
|
||||
}
|
||||
|
||||
static calculateMean(samples: any[]) {
|
||||
static calculateMean(samples: number[]) {
|
||||
var total = 0;
|
||||
// TODO: use reduce
|
||||
samples.forEach(x => total += x);
|
||||
return total / samples.length;
|
||||
}
|
||||
|
||||
static calculateStandardDeviation(samples: any[], mean) {
|
||||
static calculateStandardDeviation(samples: number[], mean) {
|
||||
var deviation = 0;
|
||||
// TODO: use reduce
|
||||
samples.forEach(x => deviation += Math.pow(x - mean, 2));
|
||||
|
Reference in New Issue
Block a user