|
|
@@ -822,6 +822,49 @@ function (_, $) {
|
|
|
version: '1.0'
|
|
|
});
|
|
|
|
|
|
+ addFuncDef({
|
|
|
+ name: 'seriesByTag',
|
|
|
+ category: categories.Special,
|
|
|
+ params: [
|
|
|
+ { name: "tagExpression", type: "string" },
|
|
|
+ { name: "tagExpression", type: "string", optional: true },
|
|
|
+ { name: "tagExpression", type: "string", optional: true },
|
|
|
+ { name: "tagExpression", type: "string", optional: true },
|
|
|
+ ],
|
|
|
+ version: '1.1'
|
|
|
+ });
|
|
|
+
|
|
|
+ addFuncDef({
|
|
|
+ name: "groupByTags",
|
|
|
+ category: categories.Special,
|
|
|
+ params: [
|
|
|
+ {
|
|
|
+ name: "function",
|
|
|
+ type: "string",
|
|
|
+ options: ['sum', 'avg', 'maxSeries']
|
|
|
+ },
|
|
|
+ { name: "tag", type: "string" },
|
|
|
+ { name: "tag", type: "string", optional: true },
|
|
|
+ { name: "tag", type: "string", optional: true },
|
|
|
+ { name: "tag", type: "string", optional: true },
|
|
|
+ ],
|
|
|
+ defaultParams: ["sum", "tag"],
|
|
|
+ version: '1.1'
|
|
|
+ });
|
|
|
+
|
|
|
+ addFuncDef({
|
|
|
+ name: "aliasByTags",
|
|
|
+ category: categories.Special,
|
|
|
+ params: [
|
|
|
+ { name: "tag", type: "string" },
|
|
|
+ { name: "tag", type: "string", optional: true },
|
|
|
+ { name: "tag", type: "string", optional: true },
|
|
|
+ { name: "tag", type: "string", optional: true },
|
|
|
+ ],
|
|
|
+ defaultParams: ["tag"],
|
|
|
+ version: '1.1'
|
|
|
+ });
|
|
|
+
|
|
|
_.each(categories, function(funcList, catName) {
|
|
|
categories[catName] = _.sortBy(funcList, 'name');
|
|
|
});
|
|
|
@@ -873,7 +916,7 @@ function (_, $) {
|
|
|
// if string contains ',' and next param is optional, split and update both
|
|
|
if (this._hasMultipleParamsInString(strValue, index)) {
|
|
|
_.each(strValue.split(','), function(partVal, idx) {
|
|
|
- this.updateParam(partVal.trim(), idx);
|
|
|
+ this.updateParam(partVal.trim(), index + idx);
|
|
|
}.bind(this));
|
|
|
return;
|
|
|
}
|