{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n# Data\n", "dates = [datetime.datetime(2019, 3, 11, 12, 14, 33), datetime.datetime(2019, 3, 12, 8, 3, 52), datetime.datetime(2019, 3, 12, 9, 23, 18), datetime.datetime(2019, 3, 12, 14, 20, 51), datetime.datetime(2019, 3, 12, 15, 13, 46), datetime.datetime(2019, 3, 12, 21, 16, 8), datetime.datetime(2019, 3, 13, 16, 54, 33), datetime.datetime(2019, 3, 13, 17, 4, 53), datetime.datetime(2019, 3, 14, 6, 36, 34), datetime.datetime(2019, 3, 14, 7, 53, 4), datetime.datetime(2019, 3, 14, 10, 52, 30), datetime.datetime(2019, 3, 14, 12, 27, 2), datetime.datetime(2019, 3, 14, 16, 21, 5), datetime.datetime(2019, 3, 14, 17, 19, 13), datetime.datetime(2019, 3, 14, 20, 50, 35), datetime.datetime(2019, 3, 15, 0, 14, 16), datetime.datetime(2019, 3, 15, 11, 8, 31), datetime.datetime(2019, 3, 15, 12, 33, 28), datetime.datetime(2019, 3, 16, 7, 6, 53)]\n", "\n", "# y values\n", "show_times = [40.45, 39.21, 40.05, 38.34, 38.4, 39.21, 38.48, 38.5, 38.67, 38.35, 38.74, 38.81, 36.01, 36.45, 36.23, 36.73, 36.47, 36.08, 36.84]\n", "show_with_cache_times = [19.12, 18.97, 19.05, 19.05, 19.23, 18.88, 19.29, 19.0, 18.91, 19.24, 19.22, 19.14, 16.9, 16.91, 17.03, 17.03, 16.89, 17.02, 17.07]\n", "build_with_cache_times = [238.1, 239.62, 238.86, 240.84, 237.92, 239.34, 238.7, 239.61, 239.13, 356.27, 356.87, 359.74, 355.01, 354.47, 358.52, 356.17, 358.99, 359.55, 358.33]\n", "show_once_built_times = [25.75, 25.72, 26.41, 25.7, 26.27, 25.92, 25.83, 25.79, 25.87, 26.34, 26.39, 26.26, 24.84, 24.26, 23.73, 23.96, 24.02, 23.61, 23.9]\n", "\n", "show_memory = [518.916, 518.892, 519.192, 519.388, 519.08, 520.312, 519.996, 520.164, 519.868, 521.944, 522.336, 522.404, 523.784, 523.472, 523.932, 523.108, 523.724, 523.616, 523.196]\n", "show_with_cache_memory = [541.848, 542.032, 542.092, 542.216, 541.724, 542.984, 543.008, 542.74, 543.044, 545.524, 544.996, 545.196, 546.28, 546.212, 547.224, 546.368, 546.312, 546.828, 546.584]\n", "build_with_cache_memory = [542.756, 542.504, 542.908, 543.532, 542.752, 543.808, 543.696, 543.444, 543.38, 546.64, 546.372, 546.592, 547.904, 547.468, 548.092, 548.16, 547.772, 548.16, 547.76]\n", "show_once_built_memory = [694.972, 694.66, 694.748, 694.76, 694.576, 695.628, 695.848, 695.404, 695.812, 698.76, 698.236, 699.068, 699.356, 699.456, 699.576, 699.672, 699.36, 699.856, 694.704]\n", "\n", "# Additional data\n", "commits = ['805b4564', '91b08ce7', 'bb830367', 'a424d33f', 'e274adf8', '2c3dfa4e', 'e4aace8d', 'ac71ea61', '3c0aab96', '8998788d', 'f8c60c6c', 'c991a066', '913289be', '60070706', '7fc25ed7', '594eda8a', '9ccf3b47', '3e39d2d2', '96426103']\n", "branches = ['!1211: jennis/move_node_get_project_path', '!1216: tristan/missing-file-errors', '!1212: tristan/cleanup-workspace-tests', '!1213: chandan/container-plugins', '!1221: jennis/assert_composition_failure', '!1175: tpollard/908', '!1224: phil/fixup-external-plugin-tests', '!: jennis/introduce_artifact_delete', '!1228: tpollard/fix-complete-nonetype', '!1124: raoul/440-source-cache', '!1215: phil/consolidate-repo-tests', '!1230: juerg/cas', '!1209: jennis/remove_node_chain_stuff', '!1210: aevri/nodefaultsset', '!1223: aevri/doc_artifact_log', '!1218: jjardon/bst-external-table', '!1226: aevri/tmpdir_for_cache_size', '!1231: aevri/direct_load_junction_projects', '!1208: juerg/cache-buildtrees']\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 }