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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
lizhongxiao
OpenXG-RAN
Commits
b48bae76
Commit
b48bae76
authored
Jan 28, 2022
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stats for multiple tests + fix stat files concatenation
parent
a3d9d50e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
ci-scripts/ran.py
ci-scripts/ran.py
+2
-2
ci-scripts/stats_monitor.py
ci-scripts/stats_monitor.py
+14
-8
No files found.
ci-scripts/ran.py
View file @
b48bae76
...
...
@@ -493,9 +493,9 @@ class RANManagement():
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 '
+
monitor_file
+
' '
+
conf_file
+
' enb 2>&1 > enb_stats_monitor_execution.log &'
,
'\$'
,
5
)
mySSH
.
command
(
'echo $USER; nohup python3 '
+
monitor_file
+
' '
+
conf_file
+
'
'
+
self
.
testCase_id
+
'
enb 2>&1 > enb_stats_monitor_execution.log &'
,
'\$'
,
5
)
else
:
mySSH
.
command
(
'echo $USER; nohup python3 '
+
monitor_file
+
' '
+
conf_file
+
' gnb 2>&1 > gnb_stats_monitor_execution.log &'
,
'\$'
,
5
)
mySSH
.
command
(
'echo $USER; nohup python3 '
+
monitor_file
+
' '
+
conf_file
+
'
'
+
self
.
testCase_id
+
'
gnb 2>&1 > gnb_stats_monitor_execution.log &'
,
'\$'
,
5
)
...
...
ci-scripts/stats_monitor.py
View file @
b48bae76
...
...
@@ -11,6 +11,7 @@ import pickle
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
yaml
import
os
class
StatMonitor
():
...
...
@@ -66,11 +67,15 @@ class StatMonitor():
files
=
[
"nrL1_stats.log"
,
"nrMAC_stats.log"
,
"nrPDCP_stats.log"
,
"nrRRC_stats.log"
]
# append each file's contents to another file (prepended with CI-) for
# post-mortem/debugging analysis
for
f
in
files
:
cmd
=
rf'cat
{
f
}
>> CI-
{
f
}
'
subprocess
.
Popen
(
shlex
.
split
(
cmd
))
#for f in files:
# cmd = 'cat '+ f + ' >> CI-' + f
# if os.path.isfile(f):
# subprocess.Popen(cmd,shell=True)
# join the files for further processing
cmd
=
rf'cat
{
shlex
.
join
(
files
)
}
'
cmd
=
'cat '
for
f
in
files
:
if
os
.
path
.
isfile
(
f
):
cmd
+=
f
+
' '
process
=
subprocess
.
Popen
(
shlex
.
split
(
cmd
),
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readlines
()
if
node_type
==
'enb'
:
...
...
@@ -79,7 +84,7 @@ class StatMonitor():
self
.
process_gnb
(
node_type
,
output
)
def
graph
(
self
,
node_type
):
def
graph
(
self
,
testcase_id
,
node_type
):
for
page
in
self
.
d
[
node_type
][
'graph'
]:
#work out a set a graphs per page
col
=
1
figure
,
axis
=
plt
.
subplots
(
len
(
self
.
d
[
node_type
][
'graph'
][
page
]),
col
,
figsize
=
(
10
,
10
))
...
...
@@ -110,13 +115,14 @@ class StatMonitor():
plt
.
tight_layout
()
#save as png
plt
.
savefig
(
node_type
+
'_stats_monitor_'
+
page
+
'.png'
)
plt
.
savefig
(
node_type
+
'_stats_monitor_'
+
testcase_id
+
'_'
+
page
+
'.png'
)
if
__name__
==
"__main__"
:
cfg_filename
=
sys
.
argv
[
1
]
#yaml file as metrics config
node
=
sys
.
argv
[
2
]
#enb or gnb
testcase_id
=
sys
.
argv
[
2
]
#test case id to name files accordingly, especially if we have several tests in a sequence
node
=
sys
.
argv
[
3
]
#enb or gnb
mon
=
StatMonitor
(
cfg_filename
)
#collecting stats when modem process is stopped
...
...
@@ -131,4 +137,4 @@ if __name__ == "__main__":
print
(
'Process stopped'
)
with
open
(
node
+
'_stats_monitor.pickle'
,
'wb'
)
as
handle
:
pickle
.
dump
(
mon
.
d
,
handle
,
protocol
=
pickle
.
HIGHEST_PROTOCOL
)
mon
.
graph
(
node
)
mon
.
graph
(
testcase_id
,
node
)
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