percentil: refactor
This commit is contained in:
8
dist/datasource-zabbix/timeseries.js
vendored
8
dist/datasource-zabbix/timeseries.js
vendored
@@ -305,6 +305,11 @@ System.register(['lodash', './utils'], function (_export, _context) {
|
||||
return ema;
|
||||
}
|
||||
|
||||
function PERCENTIL(n, values) {
|
||||
var sorted = _.sortBy(values);
|
||||
return sorted[Math.floor(sorted.length * n / 100)];
|
||||
}
|
||||
|
||||
function COUNT(values) {
|
||||
return values.length;
|
||||
}
|
||||
@@ -474,7 +479,8 @@ System.register(['lodash', './utils'], function (_export, _context) {
|
||||
AVERAGE: AVERAGE,
|
||||
MIN: MIN,
|
||||
MAX: MAX,
|
||||
MEDIAN: MEDIAN
|
||||
MEDIAN: MEDIAN,
|
||||
PERCENTIL: PERCENTIL
|
||||
};
|
||||
|
||||
_export('default', exportedFunctions);
|
||||
|
||||
Reference in New Issue
Block a user