Skip to content

Commit

Permalink
stats colors
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandroTreu committed May 17, 2024
1 parent 69f252e commit 0395227
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
25 changes: 15 additions & 10 deletions profile_parser/js/plot_stats_comparison.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const color_cfg_1 = __importDefault(require("./color_cfg"));
// Each consecutive TRACES_PER_VERSION number of files get put in the same bucket
const N_VERSIONS = 2; // Number of different benchmark versions to compare (each version gets a color in the graph)
const TRACES_PER_VERSION = 3; // Number of samples/traces per version
const PLOT_TITLE = "Zoom Frametime Comparison";
const bar_colors = ["#388E3C", "#1976D2", "orange", "blue"];
const PLOT_TITLE = "Frametime Comparison";
const bar_colors = [color_cfg_1.default.GREEN, color_cfg_1.default.BLUE, color_cfg_1.default.ORANGE, color_cfg_1.default.RED];
let sample_index = 0;
let avg_frametimes = [];
let median_frametimes = [];
Expand All @@ -31,14 +31,6 @@ for (let i = 0; i < files_in_directory.length; ++i) {
const avg_frametime = stats.AvgFrameTime;
const median_frametime = stats.MedianFrameTime;
const percentile_frametime = stats["95thPercentileFrameTime"];
let plot_filename = filename.replace("result-", "");
plot_filename = plot_filename.replace(".json", "");
if (sample_index === 3) {
plot_filename = "Optimized";
}
if (sample_index === 6) {
plot_filename = "Un-optimized";
}
avg_frametimes.push(avg_frametime);
median_frametimes.push(median_frametime);
percentile_frametimes.push(percentile_frametime);
Expand All @@ -57,6 +49,19 @@ for (let i = 0; i < files_in_directory.length; ++i) {
median_frametimes[median_frametimes.length - 1] - median_m_ft,
percentile_frametimes[percentile_frametimes.length - 1] - median_p_ft];
const y_values = [median_avg_ft, median_m_ft, median_p_ft];
let plot_filename = filename.replace("result-", "");
plot_filename = plot_filename.replace(".json", "");
if (sample_index === 3) {
// plot_filename = "Optimized";
plot_filename = "Curved";
}
if (sample_index === 6) {
// plot_filename = "Un-optimized";
plot_filename = "Angular";
}
if (sample_index === 9) {
plot_filename = "Straight";
}
const bar = {
x: ["Average", "Median", "95th Percentile"],
y: y_values,
Expand Down
28 changes: 17 additions & 11 deletions profile_parser/src/plot_stats_comparison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import colors from "./color_cfg";
const N_VERSIONS = 2; // Number of different benchmark versions to compare (each version gets a color in the graph)
const TRACES_PER_VERSION = 3; // Number of samples/traces per version

const PLOT_TITLE = "Zoom Frametime Comparison";
const bar_colors = ["#388E3C", "#1976D2", "orange", "blue"];
const PLOT_TITLE = "Frametime Comparison";
const bar_colors = [colors.GREEN, colors.BLUE, colors.ORANGE, colors.RED];

let sample_index = 0;
let avg_frametimes: number[] = [];
Expand Down Expand Up @@ -36,15 +36,6 @@ for (let i = 0; i < files_in_directory.length; ++i) {
const median_frametime = stats.MedianFrameTime;
const percentile_frametime = stats["95thPercentileFrameTime"];

let plot_filename = filename.replace("result-", "");
plot_filename = plot_filename.replace(".json", "");
if (sample_index === 3) {
plot_filename = "Optimized";
}
if (sample_index === 6) {
plot_filename = "Un-optimized";
}

avg_frametimes.push(avg_frametime);
median_frametimes.push(median_frametime);
percentile_frametimes.push(percentile_frametime);
Expand All @@ -67,6 +58,21 @@ for (let i = 0; i < files_in_directory.length; ++i) {
median_frametimes[median_frametimes.length-1] - median_m_ft,
percentile_frametimes[percentile_frametimes.length-1] - median_p_ft];
const y_values = [median_avg_ft, median_m_ft, median_p_ft];

let plot_filename = filename.replace("result-", "");
plot_filename = plot_filename.replace(".json", "");
if (sample_index === 3) {
// plot_filename = "Optimized";
plot_filename = "Curved";
}
if (sample_index === 6) {
// plot_filename = "Un-optimized";
plot_filename = "Angular";
}
if (sample_index === 9) {
plot_filename = "Straight";
}

const bar: Plot = {
x: ["Average", "Median", "95th Percentile"],
y: y_values,
Expand Down

0 comments on commit 0395227

Please sign in to comment.