"We need to specify the directory, where the demand CSV files can be found, and a dictionary that maps a system description (e.g. its name) to the corresponding CSV file (prefix). "
"We need to specify the directory, where the demand CSV files can be found, and a dictionary that maps a system description (e.g. its name) to the corresponding CSV file (prefix). To use Unicode narrow non-breaking spaces in the description format it as `u\"1000\\u202FmCPU\"`."
],
],
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {}
"metadata": {}
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# Theodolite Analysis - Plotting the Demand Metric
# Theodolite Analysis - Plotting the Demand Metric
This notebook creates a plot, showing scalability as a function that maps load intensities to the resources required for processing them. It is able to combine multiple such plots in one figure, for example, to compare multiple systems or configurations.
This notebook creates a plot, showing scalability as a function that maps load intensities to the resources required for processing them. It is able to combine multiple such plots in one figure, for example, to compare multiple systems or configurations.
The notebook takes a CSV file for each plot mapping load intensities to minimum required resources, computed by the `demand-metric-plot.ipynb` notebook.
The notebook takes a CSV file for each plot mapping load intensities to minimum required resources, computed by the `demand-metric-plot.ipynb` notebook.
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
First, we need to import some libraries, which are required for creating the plots.
First, we need to import some libraries, which are required for creating the plots.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
importos
importos
importpandasaspd
importpandasaspd
fromfunctoolsimportreduce
fromfunctoolsimportreduce
importmatplotlib.pyplotasplt
importmatplotlib.pyplotasplt
frommatplotlib.tickerimportFuncFormatter
frommatplotlib.tickerimportFuncFormatter
frommatplotlib.tickerimportMaxNLocator
frommatplotlib.tickerimportMaxNLocator
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We need to specify the directory, where the demand CSV files can be found, and a dictionary that maps a system description (e.g. its name) to the corresponding CSV file (prefix).
We need to specify the directory, where the demand CSV files can be found, and a dictionary that maps a system description (e.g. its name) to the corresponding CSV file (prefix). To use Unicode narrow non-breaking spaces in the description format it as `u"1000\u202FmCPU"`.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
results_dir='<path-to>/results'
results_dir='<path-to>/results'
experiments={
experiments={
'System XYZ':'exp200',
'System XYZ':'exp200',
}
}
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Now, we combie all systems described in `experiments`.
Now, we combie all systems described in `experiments`.
We might want to display the mappings before we plot it.
We might want to display the mappings before we plot it.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
df
df
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
The following code creates a MatPlotLib figure showing the scalability plots for all specified systems. You might want to adjust its styling etc. according to your preferences. Make sure to also set a filename.
The following code creates a MatPlotLib figure showing the scalability plots for all specified systems. You might want to adjust its styling etc. according to your preferences. Make sure to also set a filename.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
plt.style.use('ggplot')
plt.style.use('ggplot')
plt.rcParams['axes.facecolor']='w'
plt.rcParams['axes.facecolor']='w'
plt.rcParams['axes.edgecolor']='555555'
plt.rcParams['axes.edgecolor']='555555'
#plt.rcParams['ytick.color']='black'
#plt.rcParams['ytick.color']='black'
plt.rcParams['grid.color']='dddddd'
plt.rcParams['grid.color']='dddddd'
plt.rcParams['axes.spines.top']='false'
plt.rcParams['axes.spines.top']='false'
plt.rcParams['axes.spines.right']='false'
plt.rcParams['axes.spines.right']='false'
plt.rcParams['legend.frameon']='true'
plt.rcParams['legend.frameon']='true'
plt.rcParams['legend.framealpha']='1'
plt.rcParams['legend.framealpha']='1'
plt.rcParams['legend.edgecolor']='1'
plt.rcParams['legend.edgecolor']='1'
plt.rcParams['legend.borderpad']='1'
plt.rcParams['legend.borderpad']='1'
@FuncFormatter
@FuncFormatter
defload_formatter(x,pos):
defload_formatter(x,pos):
returnf'{(x/1000):.0f}k'
returnf'{(x/1000):.0f}k'
markers=['s','D','o','v','^','<','>','p','X']
markers=['s','D','o','v','^','<','>','p','X']
defsplitSerToArr(ser):
defsplitSerToArr(ser):
return[ser.index,ser.as_matrix()]
return[ser.index,ser.as_matrix()]
plt.figure()
plt.figure()
#plt.figure(figsize=(4.8, 3.6)) # For other plot sizes
#plt.figure(figsize=(4.8, 3.6)) # For other plot sizes
"This notebook allows applies Theodolite's *demand* metric to describe scalability of a SUT based on Theodolite measurement data.\n",
"This notebook applies Theodolite's *demand* metric to describe scalability of a SUT based on Theodolite measurement data.\n",
"\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",
"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",
"\n",
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# Theodolite Analysis - Demand Metric
# Theodolite Analysis - Demand Metric
This notebook allows applies Theodolite's *demand* metric to describe scalability of a SUT based on Theodolite measurement data.
This notebook applies Theodolite's *demand* metric to describe scalability of a SUT based on Theodolite measurement data.
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.
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.
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.
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 id: tags:
%% Cell type:markdown id: tags:
In the following cell, we need to specifiy:
In the following cell, we need to specifiy:
*`exp_id`: The experiment id that is to be analyzed.
*`exp_id`: The experiment id that is to be analyzed.
*`warmup_sec`: The number of seconds which are to be ignored in the beginning of each experiment.
*`warmup_sec`: The number of seconds which are to be ignored in the beginning of each experiment.
*`max_lag_trend_slope`: The maximum tolerable increase in queued messages per second.
*`max_lag_trend_slope`: The maximum tolerable increase in queued messages per second.
*`measurement_dir`: The directory where the measurement data files are to be found.
*`measurement_dir`: The directory where the measurement data files are to be found.
*`results_dir`: The directory where the computed demand CSV files are to be stored.
*`results_dir`: The directory where the computed demand CSV files are to be stored.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
exp_id=200
exp_id=200
warmup_sec=60
warmup_sec=60
max_lag_trend_slope=2000
max_lag_trend_slope=2000
measurement_dir='<path-to>/measurements'
measurement_dir='<path-to>/measurements'
results_dir='<path-to>/results'
results_dir='<path-to>/results'
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
With the following call, we compute our demand mapping.
With the following call, we compute our demand mapping.