This is an automated email from the ASF dual-hosted git repository.
wilfreds pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-web.git
The following commit(s) were added to refs/heads/master by this push:
new 3f6c5b5 [YUNIKORN-74] Handle Negative Counters (#140)
3f6c5b5 is described below
commit 3f6c5b5d77e1a63168b36a4c8743884c5a5504e4
Author: Priyansh Choudhary <[email protected]>
AuthorDate: Mon Oct 23 17:23:08 2023 +1100
[YUNIKORN-74] Handle Negative Counters (#140)
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]>
---
json-db.json | 12 ++++++++++++
src/app/components/area-chart/area-chart.component.ts | 3 +++
2 files changed, 15 insertions(+)
diff --git a/json-db.json b/json-db.json
index a9463fd..6144881 100644
--- a/json-db.json
+++ b/json-db.json
@@ -562,6 +562,18 @@
{
"timestamp": 1683692783389687867,
"totalApplications": "5"
+ },
+ {
+ "timestamp": 1683692843389687867,
+ "totalApplications": "-1"
+ },
+ {
+ "timestamp": 1683692903389687867,
+ "totalApplications": "3"
+ },
+ {
+ "timestamp": 1683692963389687867,
+ "totalApplications": "5"
}
],
"containerHistory": [
diff --git a/src/app/components/area-chart/area-chart.component.ts
b/src/app/components/area-chart/area-chart.component.ts
index b9ced84..aeb394b 100644
--- a/src/app/components/area-chart/area-chart.component.ts
+++ b/src/app/components/area-chart/area-chart.component.ts
@@ -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: {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]