Skip to content

Commit fa38110

Browse files
author
OpenShift Bot
authored
Merge pull request openshift#553 from spadgett/metrics-fix
Merged by openshift-bot
2 parents ffc2f78 + a657f78 commit fa38110

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/scripts/directives/deploymentMetrics.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ angular.module('openshiftConsole')
231231
values.push(metric.convert ? metric.convert(avg) : avg);
232232
});
233233

234-
metric.lastValue = _.last(values) || 0;
234+
if (values.length > 1) {
235+
metric.lastValue = _.last(values) || 0;
236+
}
235237

236238
return columns;
237239
}
@@ -310,7 +312,9 @@ angular.module('openshiftConsole')
310312
var descriptor = metric.descriptor;
311313
if (scope.compact && metric.compactCombineWith) {
312314
descriptor = metric.compactCombineWith;
313-
metricByID[descriptor].lastValue += metric.lastValue;
315+
if (metric.lastValue) {
316+
metricByID[descriptor].lastValue = (metricByID[descriptor].lastValue || 0) + metric.lastValue;
317+
}
314318
}
315319

316320
if (!chartByMetric[descriptor]) {

dist/scripts/scripts.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8425,7 +8425,7 @@ var b = i(a);
84258425
}), _.each(e, function(b, c) {
84268426
var d;
84278427
d = b.count ? b.total / b.count :null, f.push(Number(c)), g.push(a.convert ? a.convert(d) :d);
8428-
}), a.lastValue = _.last(g) || 0, h;
8428+
}), g.length > 1 && (a.lastValue = _.last(g) || 0), h;
84298429
}
84308430
function i(a, c) {
84318431
var e = [], g = {
@@ -8451,7 +8451,7 @@ return a[0];
84518451
function j(a) {
84528452
w || (b.loaded = !0, b.showAverage = _.size(b.pods) > 5 || b.compact, _.each(b.metrics, function(c) {
84538453
var d, e = i(a, c), f = c.descriptor;
8454-
b.compact && c.compactCombineWith && (f = c.compactCombineWith, B[f].lastValue += c.lastValue), t[f] ? (t[f].load(e), b.showAverage ? t[f].legend.hide() :t[f].legend.show()) :(d = C(c), d.data = e, t[f] = c3.generate(d));
8454+
b.compact && c.compactCombineWith && (f = c.compactCombineWith, c.lastValue && (B[f].lastValue = (B[f].lastValue || 0) + c.lastValue)), t[f] ? (t[f].load(e), b.showAverage ? t[f].legend.hide() :t[f].legend.show()) :(d = C(c), d.data = e, t[f] = c3.generate(d));
84558455
}));
84568456
}
84578457
function k() {

0 commit comments

Comments
 (0)