Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
98f7febe
Commit
98f7febe
authored
Nov 30, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(influxdb): added all functions
parent
4f04eaec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
0 deletions
+129
-0
public/app/plugins/datasource/influxdb/influx_query.ts
+3
-0
public/app/plugins/datasource/influxdb/query_part.ts
+126
-0
No files found.
public/app/plugins/datasource/influxdb/influx_query.ts
View file @
98f7febe
...
...
@@ -85,6 +85,9 @@ class InfluxQuery {
if
(
partModel
.
def
.
category
===
categories
.
Aggregations
)
{
return
false
;
}
if
(
partModel
.
def
.
category
===
categories
.
Selectors
)
{
return
false
;
}
return
true
;
});
});
...
...
public/app/plugins/datasource/influxdb/query_part.ts
View file @
98f7febe
...
...
@@ -5,6 +5,7 @@ import _ = require('lodash');
var
index
=
[];
var
categories
=
{
Aggregations
:
[],
Selectors
:
[],
Transformations
:
[],
Math
:
[],
Aliasing
:
[],
...
...
@@ -91,6 +92,10 @@ function replaceAggregationAddStrategy(selectParts, partModel) {
selectParts
[
i
]
=
partModel
;
return
;
}
if
(
part
.
def
.
category
===
categories
.
Selectors
)
{
selectParts
[
i
]
=
partModel
;
return
;
}
}
selectParts
.
splice
(
1
,
0
,
partModel
);
...
...
@@ -161,6 +166,34 @@ QueryPartDef.register({
renderer
:
fieldRenderer
,
});
// Aggregations
QueryPartDef
.
register
({
type
:
'count'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Aggregations
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'distinct'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Aggregations
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'integral'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Aggregations
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'mean'
,
addStrategy
:
replaceAggregationAddStrategy
,
...
...
@@ -171,6 +204,15 @@ QueryPartDef.register({
});
QueryPartDef
.
register
({
type
:
'median'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Aggregations
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'sum'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Aggregations
,
...
...
@@ -179,6 +221,8 @@ QueryPartDef.register({
renderer
:
functionRenderer
,
});
// transformations
QueryPartDef
.
register
({
type
:
'derivative'
,
addStrategy
:
addTransformationStrategy
,
...
...
@@ -189,6 +233,24 @@ QueryPartDef.register({
});
QueryPartDef
.
register
({
type
:
'non_negative_derivative'
,
addStrategy
:
addTransformationStrategy
,
category
:
categories
.
Transformations
,
params
:
[{
name
:
"duration"
,
type
:
"interval"
,
options
:
[
'1s'
,
'10s'
,
'1m'
,
'5min'
,
'10m'
,
'15m'
,
'1h'
]}],
defaultParams
:
[
'10s'
],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'stddev'
,
addStrategy
:
addTransformationStrategy
,
category
:
categories
.
Transformations
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'time'
,
category
:
groupByTimeFunctions
,
params
:
[{
name
:
"interval"
,
type
:
"time"
,
options
:
[
'auto'
,
'1s'
,
'10s'
,
'1m'
,
'5m'
,
'10m'
,
'15m'
,
'1h'
]
}],
...
...
@@ -204,6 +266,70 @@ QueryPartDef.register({
renderer
:
functionRenderer
,
});
// Selectors
QueryPartDef
.
register
({
type
:
'bottom'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[{
name
:
'count'
,
type
:
'int'
}],
defaultParams
:
[
3
],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'first'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'last'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'max'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'min'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[],
defaultParams
:
[],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'percentile'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[{
name
:
'nth'
,
type
:
'int'
}],
defaultParams
:
[
95
],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'top'
,
addStrategy
:
replaceAggregationAddStrategy
,
category
:
categories
.
Selectors
,
params
:
[{
name
:
'count'
,
type
:
'int'
}],
defaultParams
:
[
3
],
renderer
:
functionRenderer
,
});
QueryPartDef
.
register
({
type
:
'tag'
,
category
:
groupByTimeFunctions
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment