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
87650c15
Commit
87650c15
authored
Oct 06, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(influxdb): add tags to serie names
parent
b0addbd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
pkg/tsdb/influxdb/response_parser.go
+11
-1
pkg/tsdb/influxdb/response_parser_test.go
+2
-2
No files found.
pkg/tsdb/influxdb/response_parser.go
View file @
87650c15
...
...
@@ -45,7 +45,17 @@ func (rp *ResponseParser) parseResult(result []Row, queryResult *tsdb.QueryResul
}
func
(
rp
*
ResponseParser
)
formatName
(
row
Row
,
column
string
)
string
{
return
fmt
.
Sprintf
(
"%s.%s"
,
row
.
Name
,
column
)
tags
:=
""
for
k
,
v
:=
range
row
.
Tags
{
tags
+=
k
+
": "
+
v
}
if
tags
!=
""
{
tags
=
fmt
.
Sprintf
(
" { %s }"
,
tags
)
}
return
fmt
.
Sprintf
(
"%s.%s%s"
,
row
.
Name
,
column
,
tags
)
}
func
(
rp
*
ResponseParser
)
parseTimepoint
(
k
[]
interface
{},
valuePosition
int
)
tsdb
.
TimePoint
{
...
...
pkg/tsdb/influxdb/response_parser_test.go
View file @
87650c15
...
...
@@ -52,8 +52,8 @@ func TestInfluxdbResponseParser(t *testing.T) {
})
Convey
(
"can format serie names"
,
func
()
{
So
(
result
.
Series
[
0
]
.
Name
,
ShouldEqual
,
"cpu.mean"
)
So
(
result
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"cpu.sum"
)
So
(
result
.
Series
[
0
]
.
Name
,
ShouldEqual
,
"cpu.mean
{ datacenter: America }
"
)
So
(
result
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"cpu.sum
{ datacenter: America }
"
)
})
})
}
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