{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 6, 3, 10, 38, 52), datetime.datetime(2019, 6, 4, 10, 46, 25), datetime.datetime(2019, 6, 5, 14, 40, 18), datetime.datetime(2019, 6, 5, 15, 14, 9), datetime.datetime(2019, 6, 5, 16, 13, 52), datetime.datetime(2019, 6, 6, 9, 28, 25), datetime.datetime(2019, 6, 6, 11, 33, 45), datetime.datetime(2019, 6, 6, 12, 15, 32), datetime.datetime(2019, 6, 6, 13, 59, 5), datetime.datetime(2019, 6, 6, 14, 32, 57), datetime.datetime(2019, 6, 6, 15, 4, 18), datetime.datetime(2019, 6, 6, 15, 52, 40), datetime.datetime(2019, 6, 6, 16, 48, 33), datetime.datetime(2019, 6, 6, 17, 17, 52), datetime.datetime(2019, 6, 7, 15, 5, 50), datetime.datetime(2019, 6, 7, 15, 47, 52), datetime.datetime(2019, 6, 7, 17, 25, 11), datetime.datetime(2019, 6, 7, 18, 5, 29)]\n", "\n", "# y values\n", "show_times = [7.69, 7.38, 7.23, 7.27, 7.11, 7.05, 7.14, 7.28, 7.15, 7.3, 7.2, 7.14, 7.44, 7.13, 7.21, 7.23, 7.36, 7.29]\n", "build_4_times = [125.17, 126.73, 130.41, 126.48, 127.68, 128.33, 126.92, 126.72, 127.27, 127.26, 126.84, 127.6, 126.57, 127.16, 127.44, 126.9, 131.09, 130.36]\n", "build_8_times = [146.9, 147.77, 149.24, 151.25, 152.82, 152.76, 153.65, 146.19, 151.33, 147.35, 145.12, 147.88, 145.95, 150.14, 127.71, 126.65, 131.64, 134.05]\n", "build_12_times = [169.18, 168.41, 167.1, 168.82, 169.08, 171.09, 170.16, 169.57, 166.29, 172.53, 168.11, 168.18, 168.86, 172.01, 125.87, 125.91, 129.26, 131.35]\n", "show_once_built_times = [6.85, 6.59, 6.74, 6.64, 6.61, 6.52, 6.53, 6.56, 6.74, 6.54, 6.67, 6.57, 6.6, 6.42, 6.8, 6.65, 6.99, 7.7]\n", "\n", "show_memory = [174.62, 174.836, 174.508, 174.744, 174.632, 174.508, 174.52, 174.528, 174.632, 174.684, 174.52, 174.36, 174.616, 174.552, 174.712, 174.8, 185.592, 185.636]\n", "build_4_memory = [197.328, 197.284, 197.204, 197.34, 197.372, 197.276, 197.308, 197.46, 197.356, 197.34, 197.504, 197.356, 197.192, 197.468, 197.696, 197.808, 208.844, 208.596]\n", "build_8_memory = [197.268, 197.368, 197.312, 197.336, 197.244, 197.38, 197.384, 197.416, 197.32, 197.356, 197.376, 197.216, 197.292, 197.56, 197.764, 197.688, 208.8, 208.732]\n", "build_12_memory = [197.152, 197.348, 197.24, 197.524, 197.292, 197.58, 197.44, 197.324, 197.604, 197.38, 197.372, 197.416, 197.32, 197.676, 197.912, 197.768, 208.636, 208.872]\n", "show_once_built_memory = [198.692, 198.88, 198.712, 198.856, 198.816, 198.908, 198.668, 198.708, 198.744, 198.772, 198.708, 198.66, 198.812, 198.968, 199.236, 199.156, 210.092, 210.328]\n", "\n", "# Additional data\n", "commits = ['6b1f0476', '1233899f', 'f0288920', '24657160', 'bf8c33a1', '2e755c87', 'e0bd68ca', '0b7a9f3e', 'cdbad2be', '17da93ab', 'ff0555ab', '1e3ef2d7', '492b2ad1', '640f0ca5', '16338464', '20747fc2', '4a8a5a8f', 'bb0b3e44']\n", "branches = ['!1368: bschubert/fix-cython-trace', '!1370: bschubert/optimize-node_get', '!1334: aevri/split_jobs_parent_child', '!1366: raoul/1025-legacy-remotes', '!1371: bschubert/cythonize-valid-char-names', '!1378: bschubert/pylint-fixes', '!1376: bschubert/pylint-integration', '!1373: aevri/defensive_send_message', '!1381: jennis/fix_failing_test', '!1374: aevri/spawk', '!1375: bschubert/site-consolidation', '!1377: bschubert/pylint-artifactcache', '!1379: bschubert/optimize-loader-types', '!1380: aevri/job_msg_enum', '!1344: jennis/push_based_pipeline', '!1385: tpollard/bzrfix', '!1384: bschubert/stricter-node-api', '!1383: bschubert/optimize-extract-depends-node']\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='Uncached elements')\n", "ax1.plot(dates, show_once_built_times, 'x:g', label='Cached elements')\n", "# This is hacky, but allows us to see commits when we hover over\n", "scatter1 = ax1.scatter(dates + dates, show_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_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\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='Uncached elements')\n", "ax2.plot(dates, show_once_built_memory, 'x:g', label='Cached elements')\n", "# HACKY scatter\n", "scatter2 = ax2.scatter(dates + dates, show_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_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\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 }