diff --git a/client/src/pages/dashboard/components/table.jsx b/client/src/pages/dashboard/components/table.jsx index d4c0d4f..bc4f839 100644 --- a/client/src/pages/dashboard/components/table.jsx +++ b/client/src/pages/dashboard/components/table.jsx @@ -159,7 +159,7 @@ const TableComponent = ({ title, data, displayMax, render, xAxis, slot, zoom}) = } }) .reduce((a, b) => { - if (!b) { + if (typeof b === "undefined" || b === null) { return a; } if (item.AggloType == "min") { @@ -174,7 +174,7 @@ const TableComponent = ({ title, data, displayMax, render, xAxis, slot, zoom}) = } }, 0); - if (item.AggloType == "avg") { + if (item.AggloType == "avg" && avgIndex) { v = v / avgIndex; } diff --git a/package.json b/package.json index 55e24b7..f0003f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.12.0-unstable22", + "version": "0.12.0-unstable23", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/metrics/index.go b/src/metrics/index.go index 04f0a0b..4e941ca 100644 --- a/src/metrics/index.go +++ b/src/metrics/index.go @@ -38,8 +38,6 @@ var lock = make(chan bool, 1) func MergeMetric(SetOperation string, currentValue int, newValue int, avgIndex int) int { if SetOperation == "" { return newValue - } else if newValue == 0 { - return currentValue } else if SetOperation == "max" { if newValue > currentValue { return newValue