1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-30 23:20:06 +02:00

Add normal metrics data

This commit is contained in:
JUDIT GRESKOVITS 2017-03-21 11:11:36 +00:00 committed by Sérgio Ramos
parent c72bef0553
commit 7a2a1f95a6
3 changed files with 114345 additions and 116594 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,8 @@ import App from '@containers/app';
// import MockState from './mock-state.json';
import MockStateTesting from './mock-state-testing.json';
import MockState from './mock-state.json';
import NormalDatasets from './dataset-leak.json';
import LeakDatasets from './dataset-normal.json';
import LeakDatasets from './dataset-leak.json';
import NormalDatasets from './dataset-normal.json';
import Store from '@state/store';
if (process.env.NODE_ENV !== 'production') {

View File

@ -115,14 +115,29 @@ const metricByInterval = (data = [], {
const genStats = (sample) => {
const data = sample.values.map((r) => r.v);
const q1 = statistics.quantile(data, 0.25);
const median = statistics.median(data);
const q3 = statistics.quantile(data, 0.75);
const iqr = q3-q1;
const outlierMultiplier = 3;
let max = statistics.max(data);
if(max < q3 + iqr*outlierMultiplier) {
max = q3;
}
let min = statistics.min(data);
if(min > q1 - iqr*outlierMultiplier){
min = q3;
}
return {
start: sample.start.valueOf(),
end: sample.end.valueOf(),
firstQuartile: statistics.quantile(data, 0.25),
median: statistics.median(data),
thirdQuartile: statistics.quantile(data, 0.75),
max: statistics.max(data),
min: statistics.min(data),
firstQuartile: q1,
median: median,
thirdQuartile: q3,
max: max,
min: min,
stddev: statistics.sampleStandardDeviation(data)
};
};