{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 3, 25, 11, 0, 25), datetime.datetime(2019, 3, 25, 11, 45, 41), datetime.datetime(2019, 3, 25, 12, 29, 52), datetime.datetime(2019, 3, 25, 13, 28, 59), datetime.datetime(2019, 3, 26, 19, 10, 40), datetime.datetime(2019, 3, 27, 13, 50, 15), datetime.datetime(2019, 3, 27, 18, 49, 31), datetime.datetime(2019, 3, 28, 10, 4, 53), datetime.datetime(2019, 3, 28, 14, 4, 33), datetime.datetime(2019, 3, 28, 15, 39, 43), datetime.datetime(2019, 3, 29, 10, 37, 49), datetime.datetime(2019, 3, 29, 11, 18, 49), datetime.datetime(2019, 3, 29, 14, 24, 40), datetime.datetime(2019, 3, 29, 16, 26, 18), datetime.datetime(2019, 3, 29, 17, 12, 47), datetime.datetime(2019, 3, 29, 17, 56, 21), datetime.datetime(2019, 3, 30, 11, 57, 59)]\n", "\n", "# y values\n", "show_times = [38.27, 39.52, 39.23, 38.54, 38.69, 38.68, 39.43, 11.1, 11.12, 11.31, 11.24, 11.09, 11.36, 11.1, 11.26, 11.21, 11.49]\n", "show_with_cache_times = [16.79, 16.61, 16.64, 16.87, 16.62, 16.49, 16.74, 11.16, 11.15, 11.07, 11.17, 11.05, 11.22, 10.99, 11.0, 11.11, 11.13]\n", "build_4_times = [338.72, 338.72, 337.37, 340.28, 334.07, 337.91, 338.14, 251.91, 251.5, 250.95, 249.32, 253.42, 250.71, 252.38, 250.92, 248.31, 248.83]\n", "build_8_times = [365.41, 364.26, 365.63, 368.09, 355.16, 359.88, 357.99, 259.95, 262.58, 273.61, 260.14, 256.08, 260.16, 262.59, 258.35, 260.46, 256.81]\n", "build_12_times = [396.13, 400.26, 394.28, 396.04, 392.01, 391.42, 398.23, 291.74, 288.03, 286.95, 283.29, 285.79, 286.08, 290.24, 296.3, 287.37, 294.63]\n", "show_once_built_times = [23.58, 23.65, 23.4, 24.19, 23.91, 24.02, 23.5, 13.04, 12.96, 12.85, 12.92, 13.03, 12.71, 12.77, 13.12, 12.78, 12.73]\n", "\n", "show_memory = [521.932, 523.48, 523.556, 522.572, 522.528, 522.42, 522.924, 352.672, 351.316, 351.28, 351.428, 352.504, 352.792, 352.436, 352.108, 352.452, 352.168]\n", "show_with_cache_memory = [547.988, 548.22, 548.06, 548.012, 547.788, 548.324, 547.9, 351.928, 351.924, 351.636, 353.116, 351.984, 351.676, 352.456, 352.236, 353.36, 352.34]\n", "build_4_memory = [549.116, 549.228, 548.504, 548.304, 548.884, 548.644, 549.092, 354.756, 354.908, 355.112, 354.628, 355.588, 354.02, 354.372, 354.468, 353.084, 354.52]\n", "build_8_memory = [549.264, 548.72, 549.04, 548.224, 548.5, 549.252, 548.804, 354.888, 353.988, 354.72, 355.004, 355.416, 355.096, 355.008, 354.548, 354.84, 354.304]\n", "build_12_memory = [549.948, 548.312, 549.148, 549.02, 548.972, 548.98, 548.716, 354.512, 354.052, 354.852, 355.04, 355.108, 354.856, 354.344, 354.26, 354.12, 354.24]\n", "show_once_built_memory = [696.104, 696.632, 696.276, 695.968, 695.972, 696.224, 695.996, 469.656, 469.772, 470.812, 469.36, 469.828, 470.7, 470.836, 470.612, 469.736, 470.228]\n", "\n", "# Additional data\n", "commits = ['a6f2d34d', '1ab80a03', '753a14cc', '38d4c2ce', '80af629e', 'bcf02294', '49c22f20', 'bef450dd', 'f6de43de', '89ea4596', 'd20165a6', '83c56d54', '09e9edce', '9b62dbf5', 'd8824015', '3b976fd5', 'b8cb5832']\n", "branches = ['!1225: juerg/partial-cas', '!1253: bschubert/fix-double-lookup', '!1214: raoul/440-source-cache-remotes', '!1239: mablanch/629-remote-execution-test', '!1237: aevri/junction_load_provenance', '!1263: aevri/copyright', '!1232: juerg/partial-cas-remote', '!1257: shared/yaml-rework', '!1235: jennis/track_is_overworking', '!1265: jjardon/overnigth_tests_fix', '!1267: tpollard/pin-sphinx', '!1252: tpollard/945', '!1255: bschubert/profiler-as-cm', '!1269: bschubert/cache-project-path', '!1266: aevri/depency', '!1264: jennis/add_NEWS_entry', '!1270: bschubert/fix-typos']\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 }