{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 5, 20, 14, 59, 34), datetime.datetime(2019, 5, 21, 10, 45, 27), datetime.datetime(2019, 5, 21, 11, 40, 56), datetime.datetime(2019, 5, 21, 17, 8, 31), datetime.datetime(2019, 5, 22, 9, 29, 15), datetime.datetime(2019, 5, 22, 12, 3, 7), datetime.datetime(2019, 5, 22, 15, 12, 43), datetime.datetime(2019, 5, 23, 9, 0, 7), datetime.datetime(2019, 5, 23, 14, 56, 35), datetime.datetime(2019, 5, 23, 15, 36, 20), datetime.datetime(2019, 5, 24, 12, 44, 14), datetime.datetime(2019, 5, 24, 15, 14, 38), datetime.datetime(2019, 5, 24, 15, 50, 24)]\n", "\n", "# y values\n", "show_times = [11.45, 11.21, 11.06, 11.61, 11.18, 11.19, 11.52, 11.12, 11.04, 10.99, 11.12, 11.01, 11.12]\n", "show_with_cache_times = [11.24, 11.15, 11.19, 11.07, 11.18, 11.36, 11.03, 10.93, 11.04, 11.15, 11.0, 10.98, 10.9]\n", "build_4_times = [131.49, 132.55, 132.95, 133.91, 132.99, 133.31, 133.21, 133.43, 134.24, 133.63, 133.69, 135.09, 134.17]\n", "build_8_times = [154.39, 149.76, 154.1, 151.36, 152.81, 158.71, 155.22, 153.61, 153.93, 150.45, 155.27, 154.64, 155.73]\n", "build_12_times = [177.06, 174.44, 171.8, 176.87, 174.94, 177.45, 180.7, 175.63, 173.13, 176.14, 179.46, 175.07, 174.05]\n", "show_once_built_times = [10.52, 10.39, 10.39, 10.38, 10.44, 10.26, 10.36, 10.47, 10.5, 10.36, 10.41, 10.33, 10.36]\n", "\n", "show_memory = [186.664, 186.772, 186.812, 186.504, 186.548, 186.712, 186.676, 186.932, 186.656, 186.724, 186.496, 186.676, 186.844]\n", "show_with_cache_memory = [186.64, 186.884, 186.544, 186.924, 186.736, 186.66, 186.692, 186.732, 186.728, 186.932, 186.696, 186.644, 186.68]\n", "build_4_memory = [210.452, 210.148, 210.264, 210.288, 210.088, 210.08, 210.448, 210.14, 210.14, 210.02, 210.096, 210.252, 210.048]\n", "build_8_memory = [210.364, 210.388, 210.092, 209.968, 210.44, 210.188, 210.02, 210.492, 210.216, 210.316, 210.064, 209.984, 210.088]\n", "build_12_memory = [210.164, 210.152, 210.3, 210.304, 210.32, 210.116, 210.132, 210.124, 210.276, 210.144, 210.212, 210.312, 210.368]\n", "show_once_built_memory = [211.372, 210.876, 211.208, 210.88, 210.912, 211.212, 210.916, 211.016, 211.408, 211.024, 211.308, 211.02, 211.292]\n", "\n", "# Additional data\n", "commits = ['fb240beb', 'c1006669', '6c59e790', '25172ed2', 'd43ba46b', 'f9589364', '57212ca1', '156affd4', '91c3000b', 'b01c44fd', 'e53487a7', '66a91a2b', 'c3f9528c']\n", "branches = ['!1346: danielsilverstone-ct/classmethod-inits', '!1325: jonathan/cached-to-artifact', '!1347: chandan/coverage-doesnt-need-deps', '!1322: chandan/src-directory', '!1348: aevri/fix_logging_regex_test', '!1349: aevri/mv_job_parent_above_child', '!1340: raoul/983-cas-source-staging', '!1352: jonathan/reset_cached_when_needed', '!1354: juerg/atomic-artifact', '!1337: aevri/set_message_unique_id', '!1356: tristan/fix-workspaced-junctions', '!1357: raoul/1023-grpc-forking', '!1351: bschubert/normalize-path-in-context-tests']\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 }