{ "cells": [ { "source": [ "# Theodolite Analysis - Demand Metric\n", "\n", "This notebook applies Theodolite's *demand* metric to describe scalability of a SUT based on Theodolite measurement data.\n", "\n", "Theodolite's *demand* metric is a function, mapping load intensities to the minimum required resources (e.g., instances) that are required to process this load. With this notebook, the *demand* metric function is approximated by a map of tested load intensities to their minimum required resources.\n", "\n", "The final output when running this notebook will be a CSV file, providig this mapping. It can be used to create nice plots of a system's scalability using the `demand-metric-plot.ipynb` notebook." ], "cell_type": "markdown", "metadata": {} }, { "source": [ "In the following cell, we need to specifiy:\n", "\n", "* `exp_id`: The experiment id that is to be analyzed.\n", "* `warmup_sec`: The number of seconds which are to be ignored in the beginning of each experiment.\n", "* `max_lag_trend_slope`: The maximum tolerable increase in queued messages per second.\n", "* `measurement_dir`: The directory where the measurement data files are to be found.\n", "* `results_dir`: The directory where the computed demand CSV files are to be stored." ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "exp_id = 200\n", "warmup_sec = 60\n", "max_lag_trend_slope = 2000\n", "measurement_dir = '/measurements'\n", "results_dir = '/results'\n" ] }, { "source": [ "With the following call, we compute our demand mapping." ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from src.demand import demand\n", "\n", "demand = demand(exp_id, measurement_dir, max_lag_trend_slope, warmup_sec)" ] }, { "source": [ "We might already want to plot a simple visualization here:" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "demand.plot(kind='line',x='load',y='resources')" ] }, { "source": [ "Finally we store the results in a CSV file." ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "demand.to_csv(os.path.join(results_dir, f'exp{exp_id}_demand.csv'), index=False)" ] } ], "metadata": { "language_info": { "name": "python", "codemirror_mode": { "name": "ipython", "version": 3 }, "version": "3.8.5-final" }, "orig_nbformat": 2, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "npconvert_exporter": "python", "pygments_lexer": "ipython3", "version": 3, "kernelspec": { "name": "python37064bitvenvvenv6c432ee1239d4f3cb23f871068b0267d", "display_name": "Python 3.7.0 64-bit ('.venv': venv)", "language": "python" } }, "nbformat": 4, "nbformat_minor": 2 }