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
spbro
OpenXG-RAN
Commits
89aad980
Commit
89aad980
authored
Aug 02, 2024
by
Jaroslava Fiedlerova
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ci-iperf3-json-fix' into integration_2024_w31
parents
0a5e8b76
12229ef5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
32 deletions
+31
-32
ci-scripts/cls_oaicitest.py
ci-scripts/cls_oaicitest.py
+31
-32
No files found.
ci-scripts/cls_oaicitest.py
View file @
89aad980
...
...
@@ -96,45 +96,44 @@ def Iperf_ComputeTime(args):
return
int
(
result
.
group
(
'iperf_time'
))
def
Iperf_analyzeV3TCPJson
(
filename
,
iperf_tcp_rate_target
):
if
(
not
os
.
path
.
isfile
(
filename
)):
return
(
False
,
'Iperf3 TCP: Log file not present'
)
if
(
os
.
path
.
getsize
(
filename
)
==
0
):
return
(
False
,
'Iperf3 TCP: Log file is empty'
)
with
open
(
filename
)
as
file
:
filename
=
json
.
load
(
file
)
try
:
sender_bitrate
=
round
(
filename
[
'end'
][
'streams'
][
0
][
'sender'
][
'bits_per_second'
]
/
1000000
,
2
)
receiver_bitrate
=
round
(
filename
[
'end'
][
'streams'
][
0
][
'receiver'
][
'bits_per_second'
]
/
1000000
,
2
)
except
Exception
as
e
:
return
(
False
,
'Could not compute Iperf3 bitrate!'
)
try
:
with
open
(
filename
)
as
f
:
results
=
json
.
load
(
f
)
sender_bitrate
=
round
(
results
[
'end'
][
'streams'
][
0
][
'sender'
][
'bits_per_second'
]
/
1000000
,
2
)
receiver_bitrate
=
round
(
results
[
'end'
][
'streams'
][
0
][
'receiver'
][
'bits_per_second'
]
/
1000000
,
2
)
except
json
.
JSONDecodeError
as
e
:
return
(
False
,
f'Could not decode JSON log file
{
filename
}
:
{
e
}
'
)
except
KeyError
as
e
:
e_msg
=
results
.
get
(
'error'
,
f'error report not found in
{
filename
}
'
)
return
(
False
,
f'While parsing Iperf3 results: missing key
{
e
}
,
{
e_msg
}
'
)
except
Exception
as
e
:
return
(
False
,
f'While parsing Iperf3 results: exception:
{
e
}
'
)
snd_msg
=
f'Sender Bitrate :
{
sender_bitrate
}
Mbps'
rcv_msg
=
f'Receiver Bitrate :
{
receiver_bitrate
}
Mbps'
success
=
True
if
(
iperf_tcp_rate_target
is
not
None
)
:
if
(
int
(
receiver_bitrate
)
<
int
(
iperf_tcp_rate_target
)):
rcv_msg
+=
f" (too low! <
{
iperf_tcp_rate_target
}
Mbps)"
success
=
False
if
iperf_tcp_rate_target
is
not
None
:
success
=
float
(
receiver_bitrate
)
>=
float
(
iperf_tcp_rate_target
)
if
success
:
rcv_msg
+=
f" (target:
{
iperf_tcp_rate_target
}
)"
else
:
rcv_msg
+=
f" (t
arget :
{
iperf_tcp_rate_target
}
Mbps
)"
rcv_msg
+=
f" (t
oo low! <
{
iperf_tcp_rate_target
}
)"
return
(
success
,
f'
{
snd_msg
}
\n
{
rcv_msg
}
'
)
def
Iperf_analyzeV3BIDIRJson
(
filename
):
if
(
not
os
.
path
.
isfile
(
filename
))
:
return
(
False
,
'Iperf3 Bidir TCP: Log file not present'
)
if
(
os
.
path
.
getsize
(
filename
)
==
0
):
return
(
False
,
'Iperf3 Bidir TCP: Log file is empty'
)
with
open
(
filename
)
as
file
:
filename
=
json
.
load
(
file
)
try
:
sender_bitrate_ul
=
round
(
filename
[
'end'
][
'streams'
][
0
][
'sender'
][
'bits_per_second'
]
/
1000000
,
2
)
receiver_bitrate_ul
=
round
(
filename
[
'end'
][
'streams'
][
0
][
'receiver'
][
'bits_per_second'
]
/
1000000
,
2
)
sender_bitrate_dl
=
round
(
filename
[
'end'
][
'streams'
][
1
][
'sender'
][
'bits_per_second'
]
/
1000000
,
2
)
receiver_bitrate_dl
=
round
(
filename
[
'end'
][
'streams'
][
1
][
'receiver'
][
'bits_per_second'
]
/
1000000
,
2
)
except
Exception
as
e
:
return
(
False
,
'Could not compute BIDIR bitrate!
'
)
try
:
with
open
(
filename
)
as
f
:
results
=
json
.
load
(
f
)
sender_bitrate_ul
=
round
(
results
[
'end'
][
'streams'
][
0
][
'sender'
][
'bits_per_second'
]
/
1000000
,
2
)
receiver_bitrate_ul
=
round
(
results
[
'end'
][
'streams'
][
0
][
'receiver'
][
'bits_per_second'
]
/
1000000
,
2
)
sender_bitrate_dl
=
round
(
results
[
'end'
][
'streams'
][
1
][
'sender'
][
'bits_per_second'
]
/
1000000
,
2
)
receiver_bitrate_dl
=
round
(
results
[
'end'
][
'streams'
][
1
][
'receiver'
][
'bits_per_second'
]
/
1000000
,
2
)
except
json
.
JSONDecodeError
as
e
:
return
(
False
,
f'Could not decode JSON log file:
{
e
}
'
)
except
KeyError
as
e
:
e_msg
=
results
.
get
(
'error'
,
f'error report not found in
{
filename
}
'
)
return
(
False
,
f'While parsing Iperf3 results: missing key
{
e
}
,
{
e_msg
}
'
)
except
Exception
as
e
:
return
(
False
,
f'While parsing Iperf3 results: exception:
{
e
}
'
)
msg
=
f'Sender Bitrate DL :
{
sender_bitrate_dl
}
Mbps
\n
'
msg
+=
f'Receiver Bitrate DL :
{
receiver_bitrate_dl
}
Mbps
\n
'
...
...
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