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
38906acd
Unverified
Commit
38906acd
authored
Jun 04, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
elasticsearch: sort bucket keys to fix issue wth response parser tests
parent
49d92354
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
pkg/tsdb/elasticsearch/response_parser.go
+10
-3
No files found.
pkg/tsdb/elasticsearch/response_parser.go
View file @
38906acd
...
@@ -113,15 +113,22 @@ func (rp *responseParser) processBuckets(aggs map[string]interface{}, target *Qu
...
@@ -113,15 +113,22 @@ func (rp *responseParser) processBuckets(aggs map[string]interface{}, target *Qu
}
}
}
}
for
k
,
v
:=
range
esAgg
.
Get
(
"buckets"
)
.
MustMap
()
{
buckets
:=
esAgg
.
Get
(
"buckets"
)
.
MustMap
()
bucket
:=
simplejson
.
NewFromAny
(
v
)
bucketKeys
:=
make
([]
string
,
0
)
for
k
:=
range
buckets
{
bucketKeys
=
append
(
bucketKeys
,
k
)
}
sort
.
Strings
(
bucketKeys
)
for
_
,
bucketKey
:=
range
bucketKeys
{
bucket
:=
simplejson
.
NewFromAny
(
buckets
[
bucketKey
])
newProps
:=
make
(
map
[
string
]
string
,
0
)
newProps
:=
make
(
map
[
string
]
string
,
0
)
for
k
,
v
:=
range
props
{
for
k
,
v
:=
range
props
{
newProps
[
k
]
=
v
newProps
[
k
]
=
v
}
}
newProps
[
"filter"
]
=
k
newProps
[
"filter"
]
=
bucketKey
err
=
rp
.
processBuckets
(
bucket
.
MustMap
(),
target
,
series
,
table
,
newProps
,
depth
+
1
)
err
=
rp
.
processBuckets
(
bucket
.
MustMap
(),
target
,
series
,
table
,
newProps
,
depth
+
1
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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