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
4e229180
Unverified
Commit
4e229180
authored
Mar 12, 2019
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heatmap: fix prometheus buckets sorting, closes #15637
parent
a826c117
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
public/app/plugins/datasource/prometheus/result_transformer.ts
+5
-4
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
+1
-1
No files found.
public/app/plugins/datasource/prometheus/result_transformer.ts
View file @
4e229180
import
_
from
'lodash'
;
import
TableModel
from
'app/core/table_model'
;
import
{
TimeSeries
}
from
'@grafana/ui'
;
export
class
ResultTransformer
{
constructor
(
private
templateSrv
)
{}
...
...
@@ -18,10 +19,10 @@ export class ResultTransformer {
];
}
else
if
(
prometheusResult
&&
options
.
format
===
'heatmap'
)
{
let
seriesList
=
[];
prometheusResult
.
sort
(
sortSeriesByLabel
);
for
(
const
metricData
of
prometheusResult
)
{
seriesList
.
push
(
this
.
transformMetricData
(
metricData
,
options
,
options
.
start
,
options
.
end
));
}
seriesList
.
sort
(
sortSeriesByLabel
);
seriesList
=
this
.
transformToHistogramOverTime
(
seriesList
);
return
seriesList
;
}
else
if
(
prometheusResult
)
{
...
...
@@ -197,13 +198,13 @@ export class ResultTransformer {
}
}
function
sortSeriesByLabel
(
s1
,
s2
):
number
{
function
sortSeriesByLabel
(
s1
:
TimeSeries
,
s2
:
TimeSeries
):
number
{
let
le1
,
le2
;
try
{
// fail if not integer. might happen with bad queries
le1
=
parseHistogramLabel
(
s1
.
metric
.
le
);
le2
=
parseHistogramLabel
(
s2
.
metric
.
le
);
le1
=
parseHistogramLabel
(
s1
.
target
);
le2
=
parseHistogramLabel
(
s2
.
target
);
}
catch
(
err
)
{
console
.
log
(
err
);
return
0
;
...
...
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
View file @
4e229180
...
...
@@ -97,7 +97,7 @@ const colorSchemes = [
{
name
:
'YlOrRd'
,
value
:
'interpolateYlOrRd'
,
invert
:
'dark'
},
];
const
dsSupportHistogramSort
=
[
'
prometheus'
,
'
elasticsearch'
];
const
dsSupportHistogramSort
=
[
'elasticsearch'
];
export
class
HeatmapCtrl
extends
MetricsPanelCtrl
{
static
templateUrl
=
'module.html'
;
...
...
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