-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dividing logs and building charts for cpu and memory consumption
- Loading branch information
Showing
93 changed files
with
7,658 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import matplotlib as mpl | ||
|
||
files = [ | ||
[ | ||
"../logs/oai/oaicn/split/cpu.csv", | ||
"../logs/srsran/oaicn/split/cpu.csv", | ||
], | ||
[ | ||
"../logs/oai/open5gs/split/cpu.csv", | ||
"../logs/srsran/open5gs/split/cpu.csv", | ||
], | ||
[ | ||
"../logs/oai/free5gc/split/cpu.csv", | ||
"../logs/srsran/free5gc/split/cpu.csv", | ||
], | ||
] | ||
|
||
rans = ["OAI RAN", "srsRAN"] | ||
|
||
cores = [ | ||
"OAI CN", | ||
"Open5GS", | ||
"Free5GC", | ||
] | ||
|
||
def conv(x): | ||
return float(x)*100 | ||
|
||
def readfile(file: str): | ||
data = np.genfromtxt(file, delimiter=",", max_rows=11, usecols=[2], converters={2: conv}) | ||
return data | ||
|
||
|
||
def build(save=True): | ||
# there are 40 measurements total. They were taken every 15s | ||
# so in total the test lasted 600s | ||
x = np.arange(11) * 30 # the label locations | ||
|
||
colors = ["#7EA16B", "#C3D898"] | ||
fig, axes = plt.subplots(1, 3, layout='constrained') | ||
|
||
for tests, ax, core in zip(files, axes, cores): | ||
ax.set_ylim(0, 8) | ||
for ran, color, test in zip(rans, colors, tests): | ||
data = readfile(test) | ||
rects = ax.plot(x, data, label=ran, color=color) | ||
ax.set_xlabel(core, fontsize=12) | ||
|
||
# Add some text for labels, title and custom x-axis tick labels, etc. | ||
fig.supylabel('CPU Utilization (%)', fontsize=14) | ||
#axes[len(axes)//2].set_xlabel("Tempo (s)", fontsize=14) | ||
axes[-1].legend(loc='upper right', ncols=2, fontsize=12) | ||
fig.supxlabel("Time (s)", fontsize=14) | ||
|
||
#fig.set_tight_layout() | ||
fig.set_size_inches(10.4, 4.2) | ||
#plt.show() | ||
if save: | ||
fig.savefig("figs/cpu.pdf", dpi=100) | ||
|
||
if __name__ == "__main__": | ||
build(False) | ||
mpl.use('QtAgg') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import matplotlib as mpl | ||
|
||
files = [ | ||
[ | ||
"../logs/oai/oaicn/mono/cpu-gnb.csv", | ||
"../logs/srsran/oaicn/mono/cpu-gnb.csv", | ||
], | ||
[ | ||
"../logs/oai/open5gs/mono/cpu-gnb.csv", | ||
"../logs/srsran/open5gs/mono/cpu-gnb.csv", | ||
], | ||
[ | ||
"../logs/oai/free5gc/mono/cpu-gnb.csv", | ||
"../logs/srsran/free5gc/mono/cpu-gnb.csv", | ||
], | ||
] | ||
|
||
rans = ["OAI RAN", "srsRAN"] | ||
|
||
cores = [ | ||
"OAI CN", | ||
"Open5GS", | ||
"Free5GC", | ||
] | ||
|
||
def conv(x): | ||
return float(x)*100 | ||
|
||
def readfile(file: str): | ||
data = np.genfromtxt(file, delimiter=",", max_rows=11, usecols=[2], converters={2: conv}) | ||
return data | ||
|
||
|
||
def build(save=True): | ||
# there are 40 measurements total. They were taken every 15s | ||
# so in total the test lasted 600s | ||
x = np.arange(11) * 30 # the label locations | ||
|
||
colors = ["#7EA16B", "#C3D898"] | ||
fig, axes = plt.subplots(1, 3, layout='constrained') | ||
|
||
for tests, ax, core in zip(files, axes, cores): | ||
ax.set_ylim(0, 16) | ||
for ran, color, test in zip(rans, colors, tests): | ||
data = readfile(test) | ||
rects = ax.plot(x, data, label=ran, color=color) | ||
ax.set_xlabel(core, fontsize=12) | ||
|
||
# Add some text for labels, title and custom x-axis tick labels, etc. | ||
fig.supylabel('CPU Utilization (%)', fontsize=14) | ||
#axes[len(axes)//2].set_xlabel("Tempo (s)", fontsize=14) | ||
axes[-1].legend(loc='upper right', ncols=2, fontsize=12) | ||
fig.supxlabel("Time (s)", fontsize=14) | ||
|
||
#fig.set_tight_layout() | ||
fig.set_size_inches(10.4, 4.2) | ||
#plt.show() | ||
if save: | ||
fig.savefig("figs/cpu.pdf", dpi=100) | ||
|
||
if __name__ == "__main__": | ||
build(False) | ||
mpl.use('QtAgg') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import matplotlib as mpl | ||
|
||
files = [ | ||
[ | ||
"../logs/oai/oaicn/split/cpu-cu.csv", | ||
"../logs/srsran/oaicn/split/cpu-cu.csv", | ||
], | ||
[ | ||
"../logs/oai/open5gs/split/cpu-cu.csv", | ||
"../logs/srsran/open5gs/split/cpu-cu.csv", | ||
], | ||
[ | ||
"../logs/oai/free5gc/split/cpu-cu.csv", | ||
"../logs/srsran/free5gc/split/cpu-cu.csv", | ||
], | ||
] | ||
|
||
rans = ["OAI RAN", "srsRAN"] | ||
|
||
cores = [ | ||
"OAI CN", | ||
"Open5GS", | ||
"Free5GC", | ||
] | ||
|
||
def conv(x): | ||
return float(x)*100 | ||
|
||
def readfile(file: str): | ||
data = np.genfromtxt(file, delimiter=",", max_rows=11, usecols=[2], converters={2: conv}) | ||
return data | ||
|
||
|
||
def build(save=True): | ||
# there are 40 measurements total. They were taken every 15s | ||
# so in total the test lasted 600s | ||
x = np.arange(11) * 30 # the label locations | ||
|
||
colors = ["#7EA16B", "#C3D898"] | ||
fig, axes = plt.subplots(1, 3, layout='constrained') | ||
|
||
for tests, ax, core in zip(files, axes, cores): | ||
ax.set_ylim(0, 1) | ||
for ran, color, test in zip(rans, colors, tests): | ||
data = readfile(test) | ||
rects = ax.plot(x, data, label=ran, color=color) | ||
ax.set_xlabel(core, fontsize=12) | ||
|
||
# Add some text for labels, title and custom x-axis tick labels, etc. | ||
fig.supylabel('CPU Utilization (%)', fontsize=14) | ||
#axes[len(axes)//2].set_xlabel("Tempo (s)", fontsize=14) | ||
axes[-1].legend(loc='upper right', ncols=2, fontsize=12) | ||
fig.supxlabel("Time (s)", fontsize=14) | ||
|
||
#fig.set_tight_layout() | ||
fig.set_size_inches(10.4, 4.2) | ||
#plt.show() | ||
if save: | ||
fig.savefig("figs/cpu.pdf", dpi=100) | ||
|
||
if __name__ == "__main__": | ||
build(False) | ||
mpl.use('QtAgg') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import matplotlib as mpl | ||
|
||
files = [ | ||
[ | ||
"../logs/oai/oaicn/split/cpu-du.csv", | ||
"../logs/srsran/oaicn/split/cpu-du.csv", | ||
], | ||
[ | ||
"../logs/oai/open5gs/split/cpu-du.csv", | ||
"../logs/srsran/open5gs/split/cpu-du.csv", | ||
], | ||
[ | ||
"../logs/oai/free5gc/split/cpu-du.csv", | ||
"../logs/srsran/free5gc/split/cpu-du.csv", | ||
], | ||
] | ||
|
||
rans = ["OAI RAN", "srsRAN"] | ||
|
||
cores = [ | ||
"OAI CN", | ||
"Open5GS", | ||
"Free5GC", | ||
] | ||
|
||
def conv(x): | ||
return float(x)*100 | ||
|
||
def readfile(file: str): | ||
data = np.genfromtxt(file, delimiter=",", max_rows=11, usecols=[2], converters={2: conv}) | ||
return data | ||
|
||
|
||
def build(save=True): | ||
# there are 40 measurements total. They were taken every 15s | ||
# so in total the test lasted 600s | ||
x = np.arange(11) * 30 # the label locations | ||
|
||
colors = ["#7EA16B", "#C3D898"] | ||
fig, axes = plt.subplots(1, 3, layout='constrained') | ||
|
||
for tests, ax, core in zip(files, axes, cores): | ||
ax.set_ylim(0, 16) | ||
for ran, color, test in zip(rans, colors, tests): | ||
data = readfile(test) | ||
rects = ax.plot(x, data, label=ran, color=color) | ||
ax.set_xlabel(core, fontsize=12) | ||
|
||
# Add some text for labels, title and custom x-axis tick labels, etc. | ||
fig.supylabel('CPU Utilization (%)', fontsize=14) | ||
#axes[len(axes)//2].set_xlabel("Tempo (s)", fontsize=14) | ||
axes[-1].legend(loc='upper right', ncols=2, fontsize=12) | ||
fig.supxlabel("Time (s)", fontsize=14) | ||
|
||
#fig.set_tight_layout() | ||
fig.set_size_inches(10.4, 4.2) | ||
#plt.show() | ||
if save: | ||
fig.savefig("figs/cpu.pdf", dpi=100) | ||
|
||
if __name__ == "__main__": | ||
build(False) | ||
mpl.use('QtAgg') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import matplotlib as mpl | ||
|
||
mpl.use('QtAgg') | ||
files = [ | ||
"../logs/oai/oaicn/mono/mem.csv", | ||
"../logs/oai/open5gs/mono/mem.csv", | ||
"../logs/oai/free5gc/mono/mem.csv", | ||
"../logs/srsran/oaicn/mono/mem.csv", | ||
"../logs/srsran/open5gs/mono/mem.csv", | ||
"../logs/srsran/free5gc/mono/mem.csv", | ||
] | ||
# how many samples to skip until the start of the experiment | ||
labels = [ | ||
"OAI CN", | ||
"Open5Gs", | ||
"Free5Gc", | ||
] | ||
|
||
rans = ["OAI", "srsRAN"] | ||
|
||
def conv(x): | ||
return int(x)/1024/1024/1024 | ||
|
||
def readfile(file: str): | ||
data = np.genfromtxt(file, delimiter=",", max_rows=11, usecols=[2], converters={2: conv}) | ||
return np.average(data) | ||
|
||
|
||
x = np.arange(len(labels)) # the label locations | ||
width = 0.33 # the width of the bars | ||
multiplier = 0 | ||
|
||
colors = ["#7EA16B", "#C3D898"] | ||
fig, ax = plt.subplots(layout='constrained') | ||
|
||
for i in range(len(rans)): | ||
offset = width * multiplier | ||
data = (readfile(files[i]), readfile(files[i+2]), readfile(files[i+4])) | ||
rects = ax.bar(x + offset, data, width, label=rans[i], color=colors[i]) | ||
ax.bar_label(rects, padding=2) | ||
multiplier += 1 | ||
|
||
# Add some text for labels, title and custom x-axis tick labels, etc. | ||
ax.set_ylabel('Comsumo de memória no núcleo (GB)', fontsize=14) | ||
ax.set_xticks(x + width/2, labels, fontsize=12) | ||
ax.set_ylim(0, 4) | ||
ax.legend(loc='upper right', ncols=2, fontsize=12) | ||
|
||
plt.show() |
Oops, something went wrong.