mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 08:33:06 +00:00
More fixes around special values in graphs.
This commit is contained in:
parent
b68ecdd451
commit
6fa510d6fa
@ -384,16 +384,17 @@ Prometheus.Graph.prototype.metricToTsName = function(labels) {
|
||||
};
|
||||
|
||||
Prometheus.Graph.prototype.parseValue = function(value) {
|
||||
if (value == "NaN" || value == "Inf" || value == "-Inf") {
|
||||
// Can't display these values on a graph, so display a gap instead.
|
||||
return null;
|
||||
} else {
|
||||
return parseFloat(value);
|
||||
var val = parseFloat(value);
|
||||
if (isNaN(val)) {
|
||||
// "+Inf", "-Inf", "+Inf" will be parsed into NaN by parseFloat(). The
|
||||
// can't be graphed, so show them as gaps (null).
|
||||
return null
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
Prometheus.Graph.prototype.transformData = function(json) {
|
||||
self = this;
|
||||
var self = this;
|
||||
var palette = new Rickshaw.Color.Palette();
|
||||
if (json.type != "matrix") {
|
||||
self.showError("Result is not of matrix type! Please enter a correct expression.");
|
||||
|
@ -377,15 +377,17 @@ PromConsole.Graph = function(params) {
|
||||
};
|
||||
|
||||
PromConsole.Graph.prototype._parseValue = function(value) {
|
||||
if (value == "NaN" || value == "Inf" || value == "-Inf") {
|
||||
// Can't display these values on a graph, so display a gap instead.
|
||||
return null;
|
||||
} else {
|
||||
return parseFloat(value);
|
||||
var val = parseFloat(value);
|
||||
if (isNaN(val)) {
|
||||
// "+Inf", "-Inf", "+Inf" will be parsed into NaN by parseFloat(). The
|
||||
// can't be graphed, so show them as gaps (null).
|
||||
return null
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
PromConsole.Graph.prototype._render = function(data) {
|
||||
var self = this;
|
||||
var palette = new Rickshaw.Color.Palette();
|
||||
var series = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user