Skip to content

Commit

Permalink
Hopefully less jumpy RTT histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
thebracket committed Jan 31, 2025
1 parent 98a8c38 commit 7ee7181
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export class RttHistogram extends DashboardGraph {
},
yAxis: {
type: 'value',
name: "Samples",
name: "% of Samples",
nameLocation: 'middle',
nameGap: 40,
min: () => 0,
max: () => 100,
},
series: {
data: d,
Expand All @@ -39,8 +41,9 @@ export class RttHistogram extends DashboardGraph {

update(rtt) {
this.chart.hideLoading();
let sum = rtt.reduce((a, b) => a + b, 0);
for (let i=0; i<N_ITEMS; i++) {
this.option.series.data[i].value = rtt[i];
this.option.series.data[i].value = (rtt[i] / sum) * 100;
}
this.chart.setOption(this.option);
}
Expand Down

0 comments on commit 7ee7181

Please sign in to comment.