{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 6, 24, 11, 29, 22), datetime.datetime(2019, 6, 24, 16, 47, 33), datetime.datetime(2019, 6, 25, 10, 22, 58), datetime.datetime(2019, 6, 25, 11, 23, 4), datetime.datetime(2019, 6, 25, 23, 8, 34), datetime.datetime(2019, 6, 26, 9, 52, 44), datetime.datetime(2019, 6, 26, 12, 54, 32), datetime.datetime(2019, 6, 26, 14, 1, 7), datetime.datetime(2019, 6, 26, 16, 31, 58), datetime.datetime(2019, 6, 27, 9, 40, 59), datetime.datetime(2019, 6, 27, 13, 17, 55)]\n", "\n", "# y values\n", "show_times = [7.52, 7.24, 7.38, 7.35, 7.28, 7.29, 7.34, 7.35, 7.48, 7.64, 7.4]\n", "build_4_times = [133.06, 132.96, 136.61, 133.49, 133.28, 132.92, 133.7, 140.05, 133.34, 132.5, 134.74]\n", "build_8_times = [135.68, 133.58, 134.82, 134.19, 139.29, 133.46, 134.89, 133.22, 134.42, 139.31, 133.67]\n", "build_12_times = [133.06, 136.08, 131.06, 131.36, 130.82, 131.05, 137.49, 132.17, 131.98, 131.17, 130.74]\n", "show_once_built_times = [7.03, 6.91, 6.97, 6.89, 6.82, 6.92, 7.35, 6.97, 7.03, 6.87, 6.78]\n", "\n", "show_memory = [185.628, 187.108, 187.36, 187.152, 187.256, 187.172, 187.092, 187.132, 187.252, 187.124, 187.212]\n", "build_4_memory = [208.548, 210.012, 209.956, 210.24, 210.044, 210.02, 209.972, 209.828, 210.012, 210.024, 210.208]\n", "build_8_memory = [208.744, 210.072, 210.228, 210.036, 210.252, 210.156, 209.992, 210.236, 210.012, 210.028, 210.076]\n", "build_12_memory = [208.756, 210.02, 210.02, 209.944, 210.084, 210.34, 210.048, 209.98, 210.4, 210.22, 210.032]\n", "show_once_built_memory = [210.112, 211.604, 211.336, 211.52, 211.78, 211.428, 211.264, 211.344, 211.412, 211.66, 211.48]\n", "\n", "# Additional data\n", "commits = ['5c8642b4', '722d4567', '6fb77325', '950d7e90', '57a2baaa', '590e694c', 'e5662fa5', '72245825', 'af033797', '0ba48b73', '248786e4']\n", "branches = ['!1400: raoul/1044-blobs-on-demand', '!1406: jennis/notify_reverse_deps', '!1414: juerg/fetch-subprojects', '!1412: bschubert/remove-useless-sanitize', '!1421: chandan/misc-gitignore', '!1416: jennis/do_not_leak_project_specific_remotes', '!1420: chandan/fix-egg-info-gitignore', '!1422: chandan/fix-readme-badges', '!1410: raoul/915-capabilities-service', '!1427: juerg/source-checkout', '!1433: aevri/cascache_nits']\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 }