Skip to content

Commit

Permalink
fix(ui): correct rate in graph
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec committed Jun 4, 2021
1 parent 3445338 commit 366265a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export const graph = (pipeline: Pipeline, steps: Step[]) => {
const classNames = status.phase === 'Running' ? 'flow' : '';
(spec.sources || []).forEach((x, i) => {
const ss = (status.sourceStatuses || {})[x.name || ''] || {};
const rate = Object.values(ss.metrics || {})
const rate = Object.entries(ss.metrics || {})
// the rate will remain after scale-down, so we must filter out, as it'll be wrong
.filter(([replica, m]) => parseInt(replica, 10) < step.status.replicas)
.map(([, m]) => m)
.map(m => parseResourceQuantity(m.rate))
.reduce((a, b) => a + b, 0)
.toPrecision(3);
Expand Down

0 comments on commit 366265a

Please sign in to comment.