Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
214500a0
Commit
214500a0
authored
8 months ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Update Jupyter notebooks and dependencies
parent
279b98df
No related branches found
No related tags found
No related merge requests found
Pipeline
#17219
skipped
Stage: build
Stage: test
Stage: check
Stage: deploy
Stage: smoketest
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
analysis/Dockerfile
+1
-1
1 addition, 1 deletion
analysis/Dockerfile
analysis/README.md
+3
-4
3 additions, 4 deletions
analysis/README.md
analysis/lag-trend-graph.ipynb
+13
-13
13 additions, 13 deletions
analysis/lag-trend-graph.ipynb
analysis/requirements.txt
+4
-4
4 additions, 4 deletions
analysis/requirements.txt
with
21 additions
and
22 deletions
analysis/Dockerfile
+
1
−
1
View file @
214500a0
FROM
jupyter/base-notebook:python-3.
8
FROM
jupyter/base-notebook:python-3.
10
COPY
. /home/jovyan
COPY
. /home/jovyan
...
...
...
...
This diff is collapsed.
Click to expand it.
analysis/README.md
+
3
−
4
View file @
214500a0
...
@@ -19,9 +19,8 @@ In general, the Theodolite Analysis Jupyter notebooks should be runnable by any
...
@@ -19,9 +19,8 @@ In general, the Theodolite Analysis Jupyter notebooks should be runnable by any
we provide introductions for running notebooks with Docker and with Visual Studio Code. These intoduction may also be
we provide introductions for running notebooks with Docker and with Visual Studio Code. These intoduction may also be
a good starting point for using another service.
a good starting point for using another service.
For analyzing and visualizing benchmark results, either Docker or a Jupyter installation with Python 3.7 or 3.8 is
For analyzing and visualizing benchmark results, either Docker or a Jupyter installation with Python 3.10 is
required (e.g., in a virtual environment).
**
Please note that Python 3.9 seems not to be working as not all our
required (e.g., in a virtual environment).
dependencies are ported to Python 3.9 yet.
**
### Running with Docker
### Running with Docker
...
@@ -39,7 +38,7 @@ docker run --rm -p 8888:8888 -v "$PWD/../results":/home/jovyan/results -v "$PWD/
...
@@ -39,7 +38,7 @@ docker run --rm -p 8888:8888 -v "$PWD/../results":/home/jovyan/results -v "$PWD/
### Running with Visual Studio Code
### Running with Visual Studio Code
The
[
Visual Studio Code Documentation
](
https://code.visualstudio.com/docs/python/jupyter-support
)
shows to run Jupyter
The
[
Visual Studio Code Documentation
](
https://code.visualstudio.com/docs/python/jupyter-support
)
shows to run Jupyter
notebooks with Visual Studio Code. For our notebooks, Python 3.
7
or newer is required (e.g., in a virtual environment).
notebooks with Visual Studio Code. For our notebooks, Python 3.
10
or newer is required (e.g., in a virtual environment).
Moreover, they require some Python libraries, which can be installed by:
Moreover, they require some Python libraries, which can be installed by:
```
sh
```
sh
...
...
...
...
This diff is collapsed.
Click to expand it.
analysis/lag-trend-graph.ipynb
+
13
−
13
View file @
214500a0
...
@@ -46,8 +46,8 @@
...
@@ -46,8 +46,8 @@
"#input.plot(kind='line',x='timestamp',y='value',color='red')\n",
"#input.plot(kind='line',x='timestamp',y='value',color='red')\n",
"#plt.show()\n",
"#plt.show()\n",
"\n",
"\n",
"X = regress.iloc[:,
4
].values.reshape(-1, 1) # values converts it into a numpy array\n",
"X = regress.iloc[:,
3
].values.reshape(-1, 1) # values converts it into a numpy array\n",
"Y = regress.iloc[:,
3
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n",
"Y = regress.iloc[:,
2
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n",
"linear_regressor = LinearRegression() # create object for the class\n",
"linear_regressor = LinearRegression() # create object for the class\n",
"linear_regressor.fit(X, Y) # perform linear regression\n",
"linear_regressor.fit(X, Y) # perform linear regression\n",
"Y_pred = linear_regressor.predict(X) # make predictions"
"Y_pred = linear_regressor.predict(X) # make predictions"
...
@@ -84,8 +84,8 @@
...
@@ -84,8 +84,8 @@
"#filename = f\"exp{exp_id}_{benchmark}_{dim_value}_{instances}\"\n",
"#filename = f\"exp{exp_id}_{benchmark}_{dim_value}_{instances}\"\n",
"\n",
"\n",
"\n",
"\n",
"t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
4
].values\n",
"t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values\n",
"y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values\n",
"y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
2
].values\n",
"\n",
"\n",
"plt.figure()\n",
"plt.figure()\n",
"#plt.figure(figsize=(4, 3))\n",
"#plt.figure(figsize=(4, 3))\n",
...
@@ -109,25 +109,25 @@
...
@@ -109,25 +109,25 @@
}
}
],
],
"metadata": {
"metadata": {
"file_extension": ".py",
"kernelspec": {
"display_name": "Python 3.7.0 64-bit ('.venv': venv)",
"name": "python37064bitvenvvenv21b61136d7f443749f2918b47e00d223"
},
"language_info": {
"language_info": {
"name": "python",
"codemirror_mode": {
"codemirror_mode": {
"name": "ipython",
"name": "ipython",
"version": 3
"version": 3
},
},
"name": "python",
"version": "3.7.0-final"
"version": "3.7.0-final"
},
},
"orig_nbformat": 2,
"file_extension": ".py",
"mimetype": "text/x-python",
"mimetype": "text/x-python",
"name": "python",
"name": "python",
"npconvert_exporter": "python",
"npconvert_exporter": "python",
"orig_nbformat": 2,
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": 3,
"version": 3
"kernelspec": {
"name": "python37064bitvenvvenv21b61136d7f443749f2918b47e00d223",
"display_name": "Python 3.7.0 64-bit ('.venv': venv)"
}
},
},
"nbformat": 4,
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 2
...
...
...
...
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
```
import os
import os
import pandas as pd
import pandas as pd
import numpy as np
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import matplotlib
import matplotlib
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
```
directory = '<path-to>/results'
directory = '<path-to>/results'
#filename = 'exp1002_uc3_75000_1_totallag.csv'
#filename = 'exp1002_uc3_75000_1_totallag.csv'
filename = 'exp1002_uc3_50000_2_totallag.csv'
filename = 'exp1002_uc3_50000_2_totallag.csv'
warmup_sec = 60
warmup_sec = 60
threshold = 2000 #slope
threshold = 2000 #slope
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
```
df = pd.read_csv(os.path.join(directory, filename))
df = pd.read_csv(os.path.join(directory, filename))
input = df.iloc[::3]
input = df.iloc[::3]
#print(input)
#print(input)
input['sec_start'] = input.loc[0:, 'timestamp'] - input.iloc[0]['timestamp']
input['sec_start'] = input.loc[0:, 'timestamp'] - input.iloc[0]['timestamp']
#print(input)
#print(input)
#print(input.iloc[0, 'timestamp'])
#print(input.iloc[0, 'timestamp'])
regress = input.loc[input['sec_start'] >= warmup_sec] # Warm-Up
regress = input.loc[input['sec_start'] >= warmup_sec] # Warm-Up
#regress = input
#regress = input
#input.plot(kind='line',x='timestamp',y='value',color='red')
#input.plot(kind='line',x='timestamp',y='value',color='red')
#plt.show()
#plt.show()
X = regress.iloc[:,
4
].values.reshape(-1, 1) # values converts it into a numpy array
X = regress.iloc[:,
3
].values.reshape(-1, 1) # values converts it into a numpy array
Y = regress.iloc[:,
3
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column
Y = regress.iloc[:,
2
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column
linear_regressor = LinearRegression() # create object for the class
linear_regressor = LinearRegression() # create object for the class
linear_regressor.fit(X, Y) # perform linear regression
linear_regressor.fit(X, Y) # perform linear regression
Y_pred = linear_regressor.predict(X) # make predictions
Y_pred = linear_regressor.predict(X) # make predictions
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
```
print(linear_regressor.coef_)
print(linear_regressor.coef_)
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
```
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'
#filename = f"exp{exp_id}_{benchmark}_{dim_value}_{instances}"
#filename = f"exp{exp_id}_{benchmark}_{dim_value}_{instances}"
t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
4
].values
t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values
y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values
y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
2
].values
plt.figure()
plt.figure()
#plt.figure(figsize=(4, 3))
#plt.figure(figsize=(4, 3))
plt.plot(X, Y, c="#348ABD", label="observed")
plt.plot(X, Y, c="#348ABD", label="observed")
#plt.plot(t_warmup, y_warmup)
#plt.plot(t_warmup, y_warmup)
plt.plot(X, Y_pred, c="#E24A33", label="trend") # color='red')
plt.plot(X, Y_pred, c="#E24A33", label="trend") # color='red')
#348ABD, 7A68A6, A60628, 467821, CF4457, 188487, E24A33
#348ABD, 7A68A6, A60628, 467821, CF4457, 188487, E24A33
plt.gca().yaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: '%1.0fK' % (x * 1e-3)))
plt.gca().yaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: '%1.0fK' % (x * 1e-3)))
plt.ylabel('queued messages')
plt.ylabel('queued messages')
plt.xlabel('seconds since start')
plt.xlabel('seconds since start')
plt.legend()
plt.legend()
#ax.set_ylim(ymin=0)
#ax.set_ylim(ymin=0)
#ax.set_xlim(xmin=0)
#ax.set_xlim(xmin=0)
plt.savefig("plot.pdf", bbox_inches='tight')
plt.savefig("plot.pdf", bbox_inches='tight')
```
```
...
...
...
...
This diff is collapsed.
Click to expand it.
analysis/requirements.txt
+
4
−
4
View file @
214500a0
jupyter==1.
0.0
jupyter==1.
1.1
matplotlib==3.
2
.0
matplotlib==3.
10
.0
pandas==
1.0.1
pandas==
2.2.3
scikit-learn==1.0.2
scikit-learn==1.0.2
numpy==1.2
3.1
numpy==1.2
6.4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment