Skip to content

Commit

Permalink
new charts
Browse files Browse the repository at this point in the history
  • Loading branch information
gckopper committed Mar 25, 2024
1 parent 7cb954d commit 451761b
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions graphs/cpu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl

mpl.use('QtAgg')
files = [
"../logs/oai/free5gc/iperf/cpu-ran.csv",
"../logs/srsran/free5gc/iperf/cpu-ran.csv",
]
# how many samples to skip until the start of the experiment
skip = [
14,
19,
]

rans = ["OAI", "srsRAN"]

def conv(x):
return float(x[:-1])

def readfile(file: str, skip: int):
data = np.genfromtxt(file, delimiter=",", skip_header=skip, max_rows=40, usecols=[2], converters={2: conv})
return data


x = np.arange(40) * 15 # the label locations

colors = ["#7EA16B", "#C3D898"]
fig, ax = plt.subplots(layout='constrained')

for i in range(len(rans)):
data = readfile(files[i], skip[i])
rects = ax.plot(x, data, label=rans[i], color=colors[i])

# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Consumo de CPU (%)', fontsize=14)
ax.set_xlabel("Tempo (s)", fontsize=14)
ax.set_ylim(0, 12)
ax.legend(loc='upper right', ncols=2, fontsize=12)

plt.show()
2 changes: 1 addition & 1 deletion graphs/ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#"../logs/oai/open5gs/iperf/Memory Basic-data-as-joinbyfield-2024-03-05 16 21 22.csv", # core
"../logs/oai/open5gs/iperf/Memory Basic-data-as-joinbyfield-2024-03-05 16 21 00.csv", # RAN
#"../logs/srsran/open5gs/iperf/Memory Basic-data-as-joinbyfield-2024-03-20 17 22 53.csv", # core
"../logs/srsran/open5gs/iperf/Memory Basic-data-as-joinbyfield-2024-03-20 17 23 19.csv", # RAN
"../logs/srsran/open5gs/iperf/old/Memory Basic-data-as-joinbyfield-2024-03-04 16 58 29.csv", # RAN
#"../logs/oai/free5gc/iperf/Memory Basic-data-as-joinbyfield-2024-03-04 18 44 19.csv", # core
"../logs/oai/free5gc/iperf/Memory Basic-data-as-joinbyfield-2024-03-04 18 45 26.csv", # RAN
#"../logs/srsran/free5gc/iperf/Memory Basic-data-as-joinbyfield-2024-03-04 18 13 53.csv", # core
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 451761b

Please sign in to comment.