check if result is a scalar in order to display correct number of returned time series
This commit is contained in:
parent
09fcbf78df
commit
9c953064c3
File diff suppressed because one or more lines are too long
|
@ -415,7 +415,14 @@ Prometheus.Graph.prototype.submitQuery = function() {
|
|||
return;
|
||||
}
|
||||
var duration = new Date().getTime() - startTime;
|
||||
var totalTimeSeries = (xhr.responseJSON.data !== undefined) ? xhr.responseJSON.data.result.length : 0;
|
||||
var totalTimeSeries = 0;
|
||||
if (xhr.responseJSON.data !== undefined) {
|
||||
if (xhr.responseJSON.data.resultType === "scalar") {
|
||||
totalTimeSeries = 1;
|
||||
} else {
|
||||
totalTimeSeries = xhr.responseJSON.data.result.length;
|
||||
}
|
||||
}
|
||||
self.evalStats.html("Load time: " + duration + "ms <br /> Resolution: " + resolution + "s <br />" + "Total time series: " + totalTimeSeries);
|
||||
self.spinner.hide();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue