From e67613f9cd528f63673015cb67adc7f2216f2912 Mon Sep 17 00:00:00 2001 From: LeandroTreu Date: Mon, 6 May 2024 17:25:47 +0200 Subject: [PATCH] fixed MAX_BIN_X_VALUE --- profile_parser/js/plot_frametime_histogram.js | 4 ++-- profile_parser/src/plot_frametime_histogram.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/profile_parser/js/plot_frametime_histogram.js b/profile_parser/js/plot_frametime_histogram.js index e66d017..a781e36 100644 --- a/profile_parser/js/plot_frametime_histogram.js +++ b/profile_parser/js/plot_frametime_histogram.js @@ -30,8 +30,8 @@ for (let i = 0; i < files_in_directory.length; ++i) { const event = frames[i]; if (event.dur > MIN_FRAME_DURATION) { let event_dur_ms = event.dur / 1000; - if (event_dur_ms > MAX_BIN_X_VALUE) { - event_dur_ms = MAX_BIN_X_VALUE; + if (event_dur_ms >= MAX_BIN_X_VALUE) { + event_dur_ms = MAX_BIN_X_VALUE - 0.001; } x_array.push(event_dur_ms); } diff --git a/profile_parser/src/plot_frametime_histogram.ts b/profile_parser/src/plot_frametime_histogram.ts index 0792115..4ec20ea 100644 --- a/profile_parser/src/plot_frametime_histogram.ts +++ b/profile_parser/src/plot_frametime_histogram.ts @@ -4,7 +4,7 @@ import { plot, Plot } from 'nodeplotlib'; // Take tasks as framtimes if they are at least this long in microseconds. // Very short tasks (< 2ms) don't correspond to frames drawn. const MIN_FRAME_DURATION = 2000; -const MAX_BIN_X_VALUE = 200; +const MAX_BIN_X_VALUE = 200; // Exclusive. All values above are capped to this value for plotting. // The files should be ordered according to version benchmarked // Each consecutive TRACES_PER_VERSION number of files get put in the same bucket @@ -33,8 +33,8 @@ for (let i = 0; i < files_in_directory.length; ++i) { const event = frames[i]; if (event.dur > MIN_FRAME_DURATION) { let event_dur_ms = event.dur / 1000; - if (event_dur_ms > MAX_BIN_X_VALUE) { - event_dur_ms = MAX_BIN_X_VALUE; + if (event_dur_ms >= MAX_BIN_X_VALUE) { + event_dur_ms = MAX_BIN_X_VALUE-0.001; } x_array.push(event_dur_ms); }