Add top N and bottom N filter functions, closes #241.

This commit is contained in:
Alexander Zobnin
2016-09-24 12:44:22 +03:00
parent dfbcce9c8f
commit aa882d752e
4 changed files with 82 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ var index = [];
var categories = {
Transform: [],
Aggregate: [],
Filter: [],
Trends: [],
Alias: []
};
@@ -99,6 +100,26 @@ addFuncDef({
defaultParams: ['1m', 'avg'],
});
addFuncDef({
name: 'top',
category: 'Filter',
params: [
{ name: 'number', type: 'int' },
{ name: 'value', type: 'string', options: ['avg', 'min', 'max', 'median'] }
],
defaultParams: [5, 'avg'],
});
addFuncDef({
name: 'bottom',
category: 'Filter',
params: [
{ name: 'number', type: 'int' },
{ name: 'value', type: 'string', options: ['avg', 'min', 'max', 'median'] }
],
defaultParams: [5, 'avg'],
});
addFuncDef({
name: 'trendValue',
category: 'Trends',