Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
563fd66b
Commit
563fd66b
authored
Oct 14, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bring ulsch and dlsch stats for gnb
parent
30c5668b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
207 additions
and
101 deletions
+207
-101
ci-scripts/ran.py
ci-scripts/ran.py
+4
-3
ci-scripts/stats_monitor.py
ci-scripts/stats_monitor.py
+87
-79
ci-scripts/stats_monitor.py.old
ci-scripts/stats_monitor.py.old
+94
-0
ci-scripts/stats_monitor_conf.yaml
ci-scripts/stats_monitor_conf.yaml
+4
-4
ci-scripts/stats_monitor_dev.py
ci-scripts/stats_monitor_dev.py
+16
-13
ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
+2
-2
No files found.
ci-scripts/ran.py
View file @
563fd66b
...
...
@@ -483,12 +483,13 @@ class RANManagement():
#stats monitoring during runtime
time
.
sleep
(
20
)
monitor_file
=
'stats_monitor.py'
monitor_file
=
'../ci-scripts/stats_monitor.py'
conf_file
=
'../ci-scripts/stats_monitor_conf.yaml'
if
self
.
eNB_Stats
==
'yes'
:
if
(
self
.
air_interface
[
self
.
eNB_instance
]
==
'lte-softmodem'
)
or
(
self
.
air_interface
[
self
.
eNB_instance
]
==
'ocp-enb'
):
mySSH
.
command
(
'echo $USER; nohup python3
../ci-scripts/'
+
monitor
_file
+
' enb 2>&1 > enb_stats_monitor_execution.log &'
,
'\$'
,
5
)
mySSH
.
command
(
'echo $USER; nohup python3
'
+
monitor_file
+
' '
+
conf
_file
+
' enb 2>&1 > enb_stats_monitor_execution.log &'
,
'\$'
,
5
)
else
:
mySSH
.
command
(
'echo $USER; nohup python3
../ci-scripts/'
+
monitor
_file
+
' gnb 2>&1 > gnb_stats_monitor_execution.log &'
,
'\$'
,
5
)
mySSH
.
command
(
'echo $USER; nohup python3
'
+
monitor_file
+
' '
+
conf
_file
+
' gnb 2>&1 > gnb_stats_monitor_execution.log &'
,
'\$'
,
5
)
...
...
ci-scripts/stats_monitor.py
View file @
563fd66b
"""
To create graphs and pickle from runtime statistics in L1,MAC,RRC,PDCP files
"""
import
subprocess
import
time
import
shlex
import
re
import
sys
import
matplotlib.pyplot
as
plt
import
pickle
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
os
def
collect
(
d
,
node_type
):
if
node_type
==
'enb'
:
cmd
=
'cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log'
else
:
#'gnb'
cmd
=
'cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log'
process
=
subprocess
.
Popen
(
shlex
.
split
(
cmd
),
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readlines
()
for
l
in
output
:
tmp
=
l
.
decode
(
"utf-8"
)
result
=
re
.
match
(
rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
d
[
'PHR'
].
append
(
int
(
result
.
group
(
1
)))
d
[
'bler'
].
append
(
float
(
result
.
group
(
2
)))
d
[
'mcsoff'
].
append
(
int
(
result
.
group
(
3
)))
d
[
'mcs'
].
append
(
int
(
result
.
group
(
4
)))
def
graph
(
d
,
node_type
):
figure
,
axis
=
plt
.
subplots
(
4
,
1
,
figsize
=
(
10
,
10
))
major_ticks
=
np
.
arange
(
0
,
len
(
d
[
'PHR'
])
+
1
,
1
)
axis
[
0
].
set_xticks
(
major_ticks
)
axis
[
0
].
set_xticklabels
([])
axis
[
0
].
plot
(
d
[
'PHR'
],
marker
=
'o'
)
axis
[
0
].
set_xlabel
(
'time'
)
axis
[
0
].
set_ylabel
(
'PHR'
)
axis
[
0
].
set_title
(
"PHR"
)
major_ticks
=
np
.
arange
(
0
,
len
(
d
[
'bler'
])
+
1
,
1
)
axis
[
1
].
set_xticks
(
major_ticks
)
axis
[
1
].
set_xticklabels
([])
axis
[
1
].
plot
(
d
[
'bler'
],
marker
=
'o'
)
axis
[
1
].
set_xlabel
(
'time'
)
axis
[
1
].
set_ylabel
(
'bler'
)
axis
[
1
].
set_title
(
"bler"
)
major_ticks
=
np
.
arange
(
0
,
len
(
d
[
'mcsoff'
])
+
1
,
1
)
axis
[
2
].
set_xticks
(
major_ticks
)
axis
[
2
].
set_xticklabels
([])
axis
[
2
].
plot
(
d
[
'mcsoff'
],
marker
=
'o'
)
axis
[
2
].
set_xlabel
(
'time'
)
axis
[
2
].
set_ylabel
(
'mcsoff'
)
axis
[
2
].
set_title
(
"mcsoff"
)
major_ticks
=
np
.
arange
(
0
,
len
(
d
[
'mcs'
])
+
1
,
1
)
axis
[
3
].
set_xticks
(
major_ticks
)
axis
[
3
].
set_xticklabels
([])
axis
[
3
].
plot
(
d
[
'mcs'
],
marker
=
'o'
)
axis
[
3
].
set_xlabel
(
'time'
)
axis
[
3
].
set_ylabel
(
'mcs'
)
axis
[
3
].
set_title
(
"mcs"
)
plt
.
tight_layout
()
# Combine all the operations and display
plt
.
savefig
(
node_type
+
'_stats_monitor.png'
)
plt
.
show
()
if
__name__
==
"__main__"
:
import
yaml
class
StatMonitor
():
def
__init__
(
self
,
cfg_file
):
with
open
(
cfg_file
,
'r'
)
as
file
:
self
.
d
=
yaml
.
load
(
file
)
for
node
in
self
.
d
:
for
metric
in
self
.
d
[
node
]:
self
.
d
[
node
][
metric
]
=
[]
def
process_gnb
(
self
,
node_type
,
output
):
for
line
in
output
:
tmp
=
line
.
decode
(
"utf-8"
)
result
=
re
.
match
(
r'^.*\bdlsch_rounds\b ([0-9]+)\/([0-9]+).*\bdlsch_errors\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
self
.
d
[
node_type
][
'dlsch_err'
].
append
(
int
(
result
.
group
(
3
)))
percentage
=
float
(
result
.
group
(
2
))
/
float
(
result
.
group
(
1
))
self
.
d
[
node_type
][
'dlsch_err_perc_round_1'
].
append
(
percentage
)
result
=
re
.
match
(
r'^.*\bulsch_rounds\b ([0-9]+)\/([0-9]+).*\bulsch_errors\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
self
.
d
[
node_type
][
'ulsch_err'
].
append
(
int
(
result
.
group
(
3
)))
percentage
=
float
(
result
.
group
(
2
))
/
float
(
result
.
group
(
1
))
self
.
d
[
node_type
][
'ulsch_err_perc_round_1'
].
append
(
percentage
)
def
process_enb
(
self
,
node_type
,
output
):
for
line
in
output
:
tmp
=
line
.
decode
(
"utf-8"
)
result
=
re
.
match
(
r'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
self
.
d
[
node_type
][
'PHR'
].
append
(
int
(
result
.
group
(
1
)))
self
.
d
[
node_type
][
'bler'
].
append
(
float
(
result
.
group
(
2
)))
self
.
d
[
node_type
][
'mcsoff'
].
append
(
int
(
result
.
group
(
3
)))
self
.
d
[
node_type
][
'mcs'
].
append
(
int
(
result
.
group
(
4
)))
def
collect
(
self
,
node_type
):
if
node_type
==
'enb'
:
cmd
=
'cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log'
else
:
#'gnb'
cmd
=
'cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log'
process
=
subprocess
.
Popen
(
shlex
.
split
(
cmd
),
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readlines
()
if
node_type
==
'enb'
:
self
.
process_enb
(
node_type
,
output
)
else
:
#'gnb'
self
.
process_gnb
(
node_type
,
output
)
def
graph
(
self
,
node_type
):
col
=
1
figure
,
axis
=
plt
.
subplots
(
len
(
self
.
d
[
node_type
]),
col
,
figsize
=
(
10
,
10
))
i
=
0
for
metric
in
self
.
d
[
node_type
]:
major_ticks
=
np
.
arange
(
0
,
len
(
self
.
d
[
node_type
][
metric
])
+
1
,
1
)
axis
[
i
].
set_xticks
(
major_ticks
)
axis
[
i
].
set_xticklabels
([])
axis
[
i
].
plot
(
self
.
d
[
node_type
][
metric
],
marker
=
'o'
)
axis
[
i
].
set_xlabel
(
'time'
)
axis
[
i
].
set_ylabel
(
metric
)
axis
[
i
].
set_title
(
metric
)
i
+=
1
plt
.
tight_layout
()
# Combine all the operations and display
plt
.
savefig
(
node_type
+
'_stats_monitor.png'
)
plt
.
show
()
node_type
=
sys
.
argv
[
1
]
#enb or gnb
d
=
{}
d
[
'PHR'
]
=
[]
d
[
'bler'
]
=
[]
d
[
'mcsoff'
]
=
[]
d
[
'mcs'
]
=
[]
if
__name__
==
"__main__"
:
cfg_filename
=
sys
.
argv
[
1
]
#yaml file as metrics config
node
=
sys
.
argv
[
2
]
#enb or gnb
mon
=
StatMonitor
(
cfg_filename
)
cmd
=
'ps aux | grep modem | grep -v grep'
process
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
#collecting stats when modem process is stopped
CMD
=
'ps aux | grep mode | grep -v grep'
process
=
subprocess
.
Popen
(
CMD
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readlines
()
while
len
(
output
)
!=
0
:
collect
(
d
,
node_typ
e
)
process
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
mon
.
collect
(
nod
e
)
process
=
subprocess
.
Popen
(
CMD
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readlines
()
time
.
sleep
(
1
)
print
(
'process stopped'
)
with
open
(
node_type
+
'_stats_monitor.pickle'
,
'wb'
)
as
handle
:
pickle
.
dump
(
d
,
handle
,
protocol
=
pickle
.
HIGHEST_PROTOCOL
)
graph
(
d
,
node_type
)
print
(
'Process stopped'
)
with
open
(
node
+
'_stats_monitor.pickle'
,
'wb'
)
as
handle
:
pickle
.
dump
(
mon
.
d
,
handle
,
protocol
=
pickle
.
HIGHEST_PROTOCOL
)
mon
.
graph
(
node
)
ci-scripts/stats_monitor.py.old
0 → 100755
View file @
563fd66b
import subprocess
import time
import shlex
import re
import sys
import matplotlib.pyplot as plt
import pickle
import numpy as np
import os
def collect(d, node_type):
if node_type=='enb':
cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log'
else: #'gnb'
cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log'
process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
output = process.stdout.readlines()
for l in output:
tmp=l.decode("utf-8")
result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp)
if result is not None:
d['PHR'].append(int(result.group(1)))
d['bler'].append(float(result.group(2)))
d['mcsoff'].append(int(result.group(3)))
d['mcs'].append(int(result.group(4)))
def graph(d, node_type):
figure, axis = plt.subplots(4, 1,figsize=(10, 10))
major_ticks = np.arange(0, len(d['PHR'])+1, 1)
axis[0].set_xticks(major_ticks)
axis[0].set_xticklabels([])
axis[0].plot(d['PHR'],marker='o')
axis[0].set_xlabel('time')
axis[0].set_ylabel('PHR')
axis[0].set_title("PHR")
major_ticks = np.arange(0, len(d['bler'])+1, 1)
axis[1].set_xticks(major_ticks)
axis[1].set_xticklabels([])
axis[1].plot(d['bler'],marker='o')
axis[1].set_xlabel('time')
axis[1].set_ylabel('bler')
axis[1].set_title("bler")
major_ticks = np.arange(0, len(d['mcsoff'])+1, 1)
axis[2].set_xticks(major_ticks)
axis[2].set_xticklabels([])
axis[2].plot(d['mcsoff'],marker='o')
axis[2].set_xlabel('time')
axis[2].set_ylabel('mcsoff')
axis[2].set_title("mcsoff")
major_ticks = np.arange(0, len(d['mcs'])+1, 1)
axis[3].set_xticks(major_ticks)
axis[3].set_xticklabels([])
axis[3].plot(d['mcs'],marker='o')
axis[3].set_xlabel('time')
axis[3].set_ylabel('mcs')
axis[3].set_title("mcs")
plt.tight_layout()
# Combine all the operations and display
plt.savefig(node_type+'_stats_monitor.png')
plt.show()
if __name__ == "__main__":
node_type = sys.argv[1]#enb or gnb
d={}
d['PHR']=[]
d['bler']=[]
d['mcsoff']=[]
d['mcs']=[]
cmd='ps aux | grep modem | grep -v grep'
process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
output = process.stdout.readlines()
while len(output)!=0 :
collect(d, node_type)
process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
output = process.stdout.readlines()
time.sleep(1)
print('process stopped')
with open(node_type+'_stats_monitor.pickle', 'wb') as handle:
pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL)
graph(d, node_type)
ci-scripts/stats_monitor_conf.yaml
View file @
563fd66b
...
...
@@ -5,7 +5,7 @@ enb :
mcs
:
gnb
:
PHR
:
bler
:
mcsoff
:
mcs
:
\ No newline at end of file
dlsch_err
:
dlsch_err_perc_round_1
:
ulsch_err
:
ulsch_err_perc_round_1
:
\ No newline at end of file
ci-scripts/stats_monitor_dev.py
View file @
563fd66b
...
...
@@ -19,22 +19,25 @@ class Stat_Monitor():
self
.
d
[
node
][
metric
]
=
[]
def
process_
e
nb
(
self
,
node_type
,
output
):
for
l
in
output
:
tmp
=
l
.
decode
(
"utf-8"
)
result
=
re
.
match
(
r
f'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmc
s\b ([0-9]+)'
,
tmp
)
def
process_
g
nb
(
self
,
node_type
,
output
):
for
l
ine
in
output
:
tmp
=
l
ine
.
decode
(
"utf-8"
)
result
=
re
.
match
(
r
'^.*\bdlsch_rounds\b ([0-9]+)\/([0-9]+).*\bdlsch_error
s\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
self
.
d
[
node_type
][
'PHR'
].
append
(
int
(
result
.
group
(
1
)))
self
.
d
[
node_type
][
'bler'
].
append
(
float
(
result
.
group
(
2
)))
self
.
d
[
node_type
][
'mcsoff'
].
append
(
int
(
result
.
group
(
3
)))
self
.
d
[
node_type
][
'mcs'
].
append
(
int
(
result
.
group
(
4
)))
self
.
d
[
node_type
][
'dlsch_err'
].
append
(
int
(
result
.
group
(
3
)))
percentage
=
float
(
result
.
group
(
2
))
/
float
(
result
.
group
(
1
))
self
.
d
[
node_type
][
'dlsch_err_perc_round_1'
].
append
(
percentage
)
result
=
re
.
match
(
r'^.*\bulsch_rounds\b ([0-9]+)\/([0-9]+).*\bulsch_errors\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
self
.
d
[
node_type
][
'ulsch_err'
].
append
(
int
(
result
.
group
(
3
)))
percentage
=
float
(
result
.
group
(
2
))
/
float
(
result
.
group
(
1
))
self
.
d
[
node_type
][
'ulsch_err_perc_round_1'
].
append
(
percentage
)
def
process_
g
nb
(
self
,
node_type
,
output
):
for
l
in
output
:
tmp
=
l
.
decode
(
"utf-8"
)
result
=
re
.
match
(
r
f
'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)'
,
tmp
)
def
process_
e
nb
(
self
,
node_type
,
output
):
for
l
ine
in
output
:
tmp
=
l
ine
.
decode
(
"utf-8"
)
result
=
re
.
match
(
r'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)'
,
tmp
)
if
result
is
not
None
:
self
.
d
[
node_type
][
'PHR'
].
append
(
int
(
result
.
group
(
1
)))
self
.
d
[
node_type
][
'bler'
].
append
(
float
(
result
.
group
(
2
)))
...
...
ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
View file @
563fd66b
...
...
@@ -122,8 +122,8 @@
<testCase
id=
"070001"
>
<class>
Iperf
</class>
<desc>
iperf (UL/
3Mbps/UDP)(6
0 sec)(single-ue profile)
</desc>
<iperf_args>
-u -b
3M -t 6
0
</iperf_args>
<desc>
iperf (UL/
1Mbps/UDP)(2
0 sec)(single-ue profile)
</desc>
<iperf_args>
-u -b
1M -t 2
0
</iperf_args>
<direction>
UL
</direction>
<id>
nrmodule2_quectel
</id>
<iperf_packetloss_threshold>
5
</iperf_packetloss_threshold>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment