{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 4, 29, 9, 44, 25), datetime.datetime(2019, 4, 29, 15, 35, 15), datetime.datetime(2019, 4, 30, 11, 46, 59), datetime.datetime(2019, 4, 30, 13, 50, 23), datetime.datetime(2019, 5, 1, 9, 19, 5), datetime.datetime(2019, 5, 1, 10, 3, 14), datetime.datetime(2019, 5, 2, 15, 25, 36), datetime.datetime(2019, 5, 4, 7, 18, 21), datetime.datetime(2019, 5, 4, 8, 6, 46)]\n", "\n", "# y values\n", "show_times = [11.87, 11.86, 11.69, 11.94, 11.82, 11.57, 11.77, 11.89, 11.61]\n", "show_with_cache_times = [11.59, 11.65, 11.62, 11.44, 11.59, 11.64, 11.51, 11.56, 11.64]\n", "build_4_times = [169.29, 164.87, 163.78, 163.23, 165.47, 165.42, 163.33, 164.73, 165.07]\n", "build_8_times = [183.98, 182.46, 182.31, 186.33, 180.47, 183.63, 182.1, 179.76, 182.24]\n", "build_12_times = [220.16, 204.25, 206.47, 207.27, 212.61, 203.78, 206.79, 201.57, 204.57]\n", "show_once_built_times = [13.17, 13.27, 13.23, 13.41, 13.39, 13.25, 13.18, 13.28, 13.3]\n", "\n", "show_memory = [185.636, 185.912, 185.948, 185.66, 185.672, 186.18, 185.704, 185.576, 185.668]\n", "show_with_cache_memory = [185.532, 186.148, 185.704, 185.648, 185.724, 185.988, 185.716, 186.0, 185.72]\n", "build_4_memory = [190.136, 189.864, 190.18, 190.0, 190.112, 190.16, 189.84, 190.028, 190.204]\n", "build_8_memory = [190.176, 189.984, 190.144, 190.54, 189.956, 189.996, 190.064, 189.876, 190.06]\n", "build_12_memory = [189.668, 190.08, 189.792, 189.636, 190.352, 189.964, 189.704, 189.724, 189.876]\n", "show_once_built_memory = [193.728, 193.82, 193.728, 193.84, 193.768, 194.096, 193.66, 193.76, 193.808]\n", "\n", "# Additional data\n", "commits = ['73ef730e', '68c8df44', '0c064be9', '377f20fe', '35543cd0', 'bccb4f15', '0b5f7bbc', 'cf32c4df', '230c749e']\n", "branches = ['!1313: fixed-bug-for-pip-test', '!1312: jonathan/reduce-update-state-calls', '!1317: phil/separate-local-tests', '!1316: tristan/fix-cloned-plugin-ids', '!1318: bschubert/remove-duplicated-code', '!1304: abderrahim/non-strict-key-display', '!1324: danielsilverstone-ct/track-update', '!1320: jjardon/fedora_30_master', '!1306: jjardon/sphinx_2']\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import mplcursors\n", "# Note mplcursors is required to show commit info when we hover over a data point\n", "# The package can be installed with pip3: pip3 install mplcursors" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Time taken to show Debian's base files\n", "%matplotlib notebook\n", "\n", "fig1, ax1 = plt.subplots()\n", "\n", "# Plot date vs time (cache and no cache)\n", "ax1.plot(dates, show_times,'x:', label='No YAML cache')\n", "ax1.plot(dates, show_with_cache_times, 'x:r', label='With YAML cache')\n", "ax1.plot(dates, show_once_built_times, 'x:g', label='With YAML cache and built elements')\n", "# This is hacky, but allows us to see commits when we hover over\n", "scatter1 = ax1.scatter(dates + dates + dates, show_times + show_with_cache_times + show_once_built_times, marker='x')\n", "\n", "# Labelling\n", "ax1.set_title(\"Time taken to 'bst show' Debian's base-files\\n for last week's merge commits\")\n", "ax1.set_xlabel('Date')\n", "ax1.set_ylabel('Time (s)')\n", "ax1.legend(loc='lower left')\n", "ax1.grid()\n", "\n", "# Limit the y axis\n", "ax1.set_ylim([0, max([max(show_times), max(show_with_cache_times), max(show_once_built_times)])+5])\n", "fig1.autofmt_xdate() # Make the xaxis pretty\n", "\n", "# Add commit info to data points when mouse is hovered over\n", "labels = branches + branches + branches\n", "cursor = mplcursors.cursor(scatter1, hover=False)\n", "cursor.connect(\n", " \"add\", lambda sel: sel.annotation.set_text(labels[sel.target.index]))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Maximum memory when showing Debian's base-files\n", "fig2, ax2 = plt.subplots()\n", "\n", "# Plot date vs time (cache and no cache)\n", "ax2.plot(dates, show_memory,'x:', label='No YAML cache')\n", "ax2.plot(dates, show_with_cache_memory, 'x:r', label='With YAML cache')\n", "ax2.plot(dates, show_once_built_memory, 'x:g', label='With YAML cache and built elements')\n", "# HACKY scatter\n", "scatter2 = ax2.scatter(dates + dates + dates, show_memory + show_with_cache_memory + show_once_built_memory, marker='x')\n", "\n", "# Labelling\n", "ax2.set_title(\"Maxmimum memory when invoking 'bst show' on Debian's base-files\\n for last week's merge commits\")\n", "ax2.set_xlabel('Date')\n", "ax2.set_ylabel('Max memory (Mbytes)')\n", "ax2.legend(loc='lower left')\n", "ax2.grid() \n", "\n", "# Limit the y axis\n", "ax2.set_ylim([0, max([max(show_memory), max(show_with_cache_memory), max(show_once_built_memory)]) + 50])\n", "fig2.autofmt_xdate() # Make the xaxis pretty\n", "\n", "# Add commit info to data points when mouse is hovered over\n", "labels = branches + branches + branches\n", "cursor = mplcursors.cursor(scatter2, hover=False)\n", "cursor.connect(\n", " \"add\", lambda sel: sel.annotation.set_text(labels[sel.target.index]))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Time taken to build Debian's base-files\n", "fig3, ax3 = plt.subplots()\n", "\n", "# Plot date vs time (cache and no cache)\n", "ax3.plot(dates, build_4_times,'x:', label=\"4 builders\")\n", "ax3.plot(dates, build_8_times,'x:r', label=\"8 builders\")\n", "ax3.plot(dates, build_12_times,'x:g', label=\"12 builders\")\n", "# Hacky scatter for hovering over data points\n", "scatter3 = ax3.scatter(dates + dates + dates, build_4_times + build_8_times + build_12_times, marker='x')\n", "\n", "# Labelling\n", "ax3.set_title(\"Time taken to 'build' Debian's base-files\\n for last week's merge commits\")\n", "ax3.set_xlabel('Date')\n", "ax3.set_ylabel('Time (s)')\n", "ax3.legend(loc='lower left')\n", "ax3.grid()\n", "\n", "# Limit the y axis\n", "ax3.set_ylim([0, max([max(build_4_times), max(build_8_times), max(build_12_times)]) + 50])\n", "fig3.autofmt_xdate() # Make the xaxis pretty\n", "\n", "# Add commit info to data points when mouse is hovered over\n", "labels = branches + branches + branches\n", "cursor = mplcursors.cursor(scatter3, hover=False)\n", "cursor.connect(\n", " \"add\", lambda sel: sel.annotation.set_text(labels[sel.target.index]))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Maximum memory when building Debian's base-files\n", "fig4, ax4 = plt.subplots()\n", "\n", "# Plot date vs time (cache and no cache)\n", "# Note this is a line graph with a scatter plot on top, so that we can attach info to data points\n", "#line = ax4.plot(dates, build_with_cache_memory,':')\n", "#scatter4 = ax4.scatter(dates, build_with_cache_memory, marker='x')\n", "ax4.plot(dates, build_4_memory, 'x:', label=\"4 builders\")\n", "ax4.plot(dates, build_8_memory, 'x:r', label=\"8 builders\")\n", "ax4.plot(dates, build_12_memory, 'x:g', label=\"12 builders\")\n", "\n", "scatter4 = ax4.scatter(dates + dates + dates, build_4_memory + build_8_memory + build_12_memory, marker='x')\n", "\n", "# Title and label axis and add grid\n", "ax4.set_title(\"Max memory usage when 'building' Debian's base-files\\n for last week's merge commits\")\n", "ax4.set_xlabel('Date')\n", "ax4.set_ylabel('Memory (Mbytes)')\n", "ax4.legend(loc='lower left')\n", "ax4.grid()\n", "\n", "ax4.set_ylim([0, max([max(build_4_memory), max(build_8_memory), max(build_12_memory)]) + 50]) # Limit the y axis\n", "fig4.autofmt_xdate() # Make the xaxis pretty\n", "\n", "# Add commit info to data points when mouse is hovered over\n", "labels = branches + branches + branches\n", "cursor = mplcursors.cursor(scatter4, hover=False)\n", "cursor.connect(\n", " \"add\", lambda sel: sel.annotation.set_text(labels[sel.target.index]))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }