{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 5, 27, 19, 30, 36), datetime.datetime(2019, 5, 29, 1, 54, 57), datetime.datetime(2019, 5, 29, 16, 32, 53), datetime.datetime(2019, 5, 30, 9, 34, 49), datetime.datetime(2019, 5, 30, 11, 25, 51), datetime.datetime(2019, 5, 30, 15, 24, 30), datetime.datetime(2019, 5, 31, 9, 39, 4), datetime.datetime(2019, 5, 31, 14, 15, 43)]\n", "\n", "# y values\n", "show_times = [11.01, 11.02, 11.15, 7.47, 7.64, 7.37, 7.54, 7.7]\n", "build_4_times = [135.55, 133.2, 134.84, 126.69, 126.49, 126.75, 126.93, 127.41]\n", "build_8_times = [159.19, 170.68, 154.1, 150.47, 150.36, 146.42, 147.2, 145.36]\n", "build_12_times = [177.11, 189.42, 176.24, 169.31, 167.05, 170.03, 173.67, 171.13]\n", "show_once_built_times = [10.46, 10.44, 10.6, 6.96, 6.93, 6.95, 6.91, 7.03]\n", "\n", "show_memory = [186.704, 186.88, 186.9, 174.688, 174.692, 174.716, 174.624, 174.492]\n", "build_4_memory = [210.092, 209.152, 209.224, 197.272, 197.388, 197.464, 197.232, 197.132]\n", "build_8_memory = [210.104, 209.14, 209.292, 197.604, 197.292, 197.58, 197.368, 197.348]\n", "build_12_memory = [210.16, 209.536, 209.044, 197.328, 197.468, 197.3, 197.328, 197.44]\n", "show_once_built_memory = [211.24, 210.912, 210.86, 198.872, 198.436, 199.024, 198.848, 198.856]\n", "\n", "# Additional data\n", "commits = ['7dd64a42', '806801da', '4b450f66', '8b302c55', '02483728', '194bffca', 'fd91071f', '3f91a423']\n", "branches = ['!1359: jjardon/fix_overnigth_test', '!1361: jjardon/pygobject3-devel', '!1363: bschubert/iterative-loader', '!1350: bschubert/cython', '!1364: danielsilverstone-ct/iterative-circdeps', '!1365: danielsilverstone-ct/iterative-loader-bits', '!1362: raoul/1024-artifact-docs', '!1367: bschubert/cython-disable-linetrace']\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 }