{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 3, 20, 7, 13, 11), datetime.datetime(2019, 3, 20, 8, 2, 48), datetime.datetime(2019, 3, 20, 9, 24, 22), datetime.datetime(2019, 3, 20, 10, 18, 34), datetime.datetime(2019, 3, 20, 13, 23, 48), datetime.datetime(2019, 3, 20, 17, 12, 12), datetime.datetime(2019, 3, 21, 0, 0, 6), datetime.datetime(2019, 3, 21, 10, 3, 44), datetime.datetime(2019, 3, 21, 11, 24, 28), datetime.datetime(2019, 3, 21, 14, 55, 45), datetime.datetime(2019, 3, 21, 15, 55, 46), datetime.datetime(2019, 3, 21, 16, 37, 14), datetime.datetime(2019, 3, 21, 17, 40, 54), datetime.datetime(2019, 3, 21, 19, 11, 46), datetime.datetime(2019, 3, 22, 13, 0, 9)]\n", "\n", "# y values\n", "show_times = [36.88, 36.3, 36.73, 36.59, 36.24, 36.54, 36.19, 36.46, 36.28, 37.4, 36.63, 36.6, 36.85, 36.15, 38.17]\n", "show_with_cache_times = [16.81, 16.73, 17.0, 16.94, 17.06, 16.9, 17.14, 16.95, 16.82, 16.75, 17.0, 16.99, 17.06, 16.85, 16.52]\n", "build_with_cache_times = [350.12, 353.79, 351.82, 351.51, 353.77, 354.05, 355.32, 354.05, 355.62, 355.87, 360.38, 355.2, 358.28, 357.92, 337.38]\n", "show_once_built_times = [23.98, 23.56, 23.55, 23.71, 23.8, 23.9, 23.29, 23.91, 23.83, 24.57, 23.63, 23.44, 23.79, 23.59, 23.04]\n", "\n", "show_memory = [523.7, 523.216, 524.044, 523.544, 523.388, 523.344, 523.752, 523.272, 523.8, 526.016, 525.876, 526.06, 526.516, 525.184, 525.26]\n", "show_with_cache_memory = [546.352, 546.804, 546.208, 546.8, 546.564, 546.42, 547.58, 546.916, 546.256, 548.744, 548.888, 548.304, 548.34, 548.62, 549.256]\n", "build_with_cache_memory = [547.856, 547.952, 547.576, 546.784, 547.688, 547.52, 548.196, 547.16, 547.724, 549.8, 549.952, 549.92, 549.464, 549.404, 549.836]\n", "show_once_built_memory = [694.484, 695.06, 694.484, 694.872, 694.856, 695.008, 695.148, 694.828, 695.012, 696.836, 696.632, 697.076, 696.508, 696.08, 696.884]\n", "\n", "# Additional data\n", "commits = ['5bf767fd', '1b7f59f8', 'bbc5c972', 'e1b1e6c9', 'eb12178d', '408c38a6', 'c398dd77', '62031e89', 'c7470141', 'bc1b971e', '7b8c730e', 'aa326c93', 'c5f7df23', 'bdc5ac22', '5754ac64']\n", "branches = ['!1243: tristan/move-conftest-into-tests', '!1244: tristan/fix-xdg-env-in-tests', '!1236: aevri/str_e', '!1222: bschubert/linter-for-tests', '!1241: jonathan/wsl-tests-manual', '!1240: aevri/element_loaderror_detail', '!1249: chandan/remove-manifest-conftest', '!1248: bschubert/lint/logging-format', '!1246: pointswaves/softreset', '!1070: bschubert/pipeline', '!1245: aevri/dirname_basename', '!1227: aevri/you_only_write_once', '!1247: bschubert/better-pytest-report', '!1238: raoul/source-key-fix', '!1254: bschubert/optimize-dependencies']\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_with_cache_times,'x:')\n", "# Hacky scatter for hovering over data points\n", "scatter3 = ax3.scatter(dates, build_with_cache_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.grid()\n", "\n", "# Limit the y axis\n", "ax3.set_ylim([0, max(build_with_cache_times) + 50])\n", "fig3.autofmt_xdate() # Make the xaxis pretty\n", "\n", "# Add commit info to data points when mouse is hovered over\n", "cursor = mplcursors.cursor(scatter3, hover=False)\n", "cursor.connect(\n", " \"add\", lambda sel: sel.annotation.set_text(branches[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", "\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.grid()\n", "\n", "ax4.set_ylim([0, max(build_with_cache_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", "cursor = mplcursors.cursor(scatter4, hover=False)\n", "cursor.connect(\n", " \"add\", lambda sel: sel.annotation.set_text(branches[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.7.1" } }, "nbformat": 4, "nbformat_minor": 2 }