X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fbabeltrace-benchmark%2Fbenchmark.py;h=c31f87b0a219587404711a536678167d4f0bbc8f;hb=77d2de479c2522ca159958e1dbb67a3bc794648a;hp=c7dc999b7b87eb9e04ba1bb61b168583d68dd056;hpb=cf595cda908ca613992f96bc8620ed98bc4f60e9;p=lttng-ci.git diff --git a/scripts/babeltrace-benchmark/benchmark.py b/scripts/babeltrace-benchmark/benchmark.py index c7dc999..c31f87b 100644 --- a/scripts/babeltrace-benchmark/benchmark.py +++ b/scripts/babeltrace-benchmark/benchmark.py @@ -197,6 +197,7 @@ def plot_raw_value(branch, benchmark_type, x_data, y_data, labels, latest_values plt.ylabel("User + system time (s)") plt.xlabel("Latest commits") plt.legend() + plt.grid(True) # Put tick on the right side ax.tick_params(labeltop=False, labelright=True) @@ -204,7 +205,10 @@ def plot_raw_value(branch, benchmark_type, x_data, y_data, labels, latest_values plt.tight_layout() return -def plot_delta_between_point(branch, benchmark_type, x_data, y_data, labels, latest_values): + +def plot_delta_between_point( + branch, benchmark_type, x_data, y_data, labels, latest_values +): """ Plot the graph of delta between each sequential commit. """ @@ -229,10 +233,14 @@ def plot_delta_between_point(branch, benchmark_type, x_data, y_data, labels, lat ax = plt.gca() plt.xticks(x_data, labels, rotation=90, family="monospace") - plt.title(graph_get_title(branch, benchmark_type) + " Delta to previous commit", fontweight="bold") + plt.title( + graph_get_title(branch, benchmark_type) + " Delta to previous commit", + fontweight="bold", + ) plt.ylabel("Seconds") plt.xlabel("Latest commits") plt.legend() + plt.grid(True) # Put tick on the right side ax.tick_params(labeltop=False, labelright=True) @@ -240,6 +248,7 @@ def plot_delta_between_point(branch, benchmark_type, x_data, y_data, labels, lat plt.tight_layout() return + def plot_ratio(branch, benchmark_type, x_data, y_data, labels, latest_values): """ Plot the graph using a ratio using first point as reference (0%). @@ -292,6 +301,7 @@ def plot_ratio(branch, benchmark_type, x_data, y_data, labels, latest_values): plt.ylabel("Ratio") plt.xlabel("Latest commits") plt.legend() + plt.grid(True) # Put tick on the right side ax.tick_params(labeltop=False, labelright=True) @@ -299,6 +309,7 @@ def plot_ratio(branch, benchmark_type, x_data, y_data, labels, latest_values): plt.tight_layout() return + def generate_graph(branches, report_name, git_path): # The PDF document @@ -359,7 +370,9 @@ def generate_graph(branches, report_name, git_path): pdf_pages.savefig(fig) fig = plt.figure(figsize=(width, 8.27), dpi=100) - plot_delta_between_point(branch, b_type, x_data, y_data, labels, latest_values) + plot_delta_between_point( + branch, b_type, x_data, y_data, labels, latest_values + ) pdf_pages.savefig(fig) pdf_pages.close()