Skip to content

Commit

Permalink
[YUNIKORN-74] Handle Negative Counters (#140)
Browse files Browse the repository at this point in the history
All returned values in the container count that are unknown (i.e. -1)
will be plotted as 0 in the graph.
This is an arbitrary choice but since we have no further detail to work
with it is better than an unexplained negative value.

Closes: #140

Signed-off-by: Wilfred Spiegelenburg <[email protected]>
  • Loading branch information
Priyansh Choudhary authored and wilfred-s committed Oct 23, 2023
1 parent 5fa48ad commit 3f6c5b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions json-db.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,18 @@
{
"timestamp": 1683692783389687867,
"totalApplications": "5"
},
{
"timestamp": 1683692843389687867,
"totalApplications": "-1"
},
{
"timestamp": 1683692903389687867,
"totalApplications": "3"
},
{
"timestamp": 1683692963389687867,
"totalApplications": "5"
}
],
"containerHistory": [
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/area-chart/area-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export class AreaChartComponent implements OnInit, AfterViewInit, OnChanges, OnD
this.areaChart.destroy();
}

// Filter out negative values from chartData
chartData = chartData.filter(item => item.y >= 0);

this.areaChart = new Chart(ctx!, {
type: 'line',
data: {
Expand Down

0 comments on commit 3f6c5b5

Please sign in to comment.