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
76be9fe5
Commit
76be9fe5
authored
Oct 03, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
poc : add radio monitor script for test runtime
parent
a7a8a6cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
ci-scripts/radio_monitor.py
ci-scripts/radio_monitor.py
+89
-0
No files found.
ci-scripts/radio_monitor.py
0 → 100755
View file @
76be9fe5
import
subprocess
import
time
import
shlex
import
re
import
sys
import
matplotlib.pyplot
as
plt
import
pickle
import
numpy
as
np
def
collect
(
d
):
cmd
=
'cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_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
):
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
(
'/tmp/radio_monitor_dump.png'
)
plt
.
show
()
if
__name__
==
"__main__"
:
d
=
{}
d
[
'PHR'
]
=
[]
d
[
'bler'
]
=
[]
d
[
'mcsoff'
]
=
[]
d
[
'mcs'
]
=
[]
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
)
process
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
output
=
process
.
stdout
.
readlines
()
time
.
sleep
(
1
)
print
(
'process stopped'
)
with
open
(
'/tmp/radio_monitor_dump.pickle'
,
'wb'
)
as
handle
:
pickle
.
dump
(
d
,
handle
,
protocol
=
pickle
.
HIGHEST_PROTOCOL
)
graph
(
d
)
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