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
24a3a100
Commit
24a3a100
authored
Nov 08, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(influxdb): add alias to query
parent
029e52f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
pkg/tsdb/influxdb/model_parser.go
+2
-0
pkg/tsdb/influxdb/model_parser_test.go
+2
-0
pkg/tsdb/influxdb/models.go
+1
-0
No files found.
pkg/tsdb/influxdb/model_parser.go
View file @
24a3a100
...
...
@@ -13,6 +13,7 @@ func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSo
policy
:=
model
.
Get
(
"policy"
)
.
MustString
(
"default"
)
rawQuery
:=
model
.
Get
(
"query"
)
.
MustString
(
""
)
interval
:=
model
.
Get
(
"interval"
)
.
MustString
(
""
)
alias
:=
model
.
Get
(
"alias"
)
.
MustString
(
""
)
measurement
:=
model
.
Get
(
"measurement"
)
.
MustString
(
""
)
...
...
@@ -52,6 +53,7 @@ func (qp *InfluxdbQueryParser) Parse(model *simplejson.Json, dsInfo *tsdb.DataSo
Selects
:
selects
,
RawQuery
:
rawQuery
,
Interval
:
interval
,
Alias
:
alias
,
},
nil
}
...
...
pkg/tsdb/influxdb/model_parser_test.go
View file @
24a3a100
...
...
@@ -90,6 +90,7 @@ func TestInfluxdbQueryParser(t *testing.T) {
}
]
],
"alias": "serie alias",
"tags": [
{
"key": "datacenter",
...
...
@@ -115,6 +116,7 @@ func TestInfluxdbQueryParser(t *testing.T) {
So
(
len
(
res
.
Selects
),
ShouldEqual
,
3
)
So
(
len
(
res
.
Tags
),
ShouldEqual
,
2
)
So
(
res
.
Interval
,
ShouldEqual
,
">20s"
)
So
(
res
.
Alias
,
ShouldEqual
,
"serie alias"
)
})
Convey
(
"can part raw query json model"
,
func
()
{
...
...
pkg/tsdb/influxdb/models.go
View file @
24a3a100
...
...
@@ -8,6 +8,7 @@ type Query struct {
GroupBy
[]
*
QueryPart
Selects
[]
*
Select
RawQuery
string
Alias
string
Interval
string
}
...
...
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