Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
s_doering
asteriskperf-python-wrapper
Commits
e40658f6
Commit
e40658f6
authored
Oct 06, 2015
by
Deathcrow
Browse files
forgot to commit
parent
08cc0c6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
aggregate-mod.py
100644 → 100755
View file @
e40658f6
...
...
@@ -70,6 +70,7 @@ parser = argparse.ArgumentParser(description='Configure test environment.')
parser
.
add_argument
(
'folders'
,
nargs
=
"*"
,
default
=
"./"
,
help
=
"Folder to search for files"
)
parser
.
add_argument
(
'-m'
,
'--mask'
,
default
=
""
)
parser
.
add_argument
(
'-t'
,
'--time'
,
default
=
"300"
,
help
=
"Length of tests to analyze (for bw)"
)
args
=
parser
.
parse_args
()
...
...
@@ -101,27 +102,36 @@ for folder in args.folders:
rtt_values_file
.
write
(
line
[
9
]
+
'
\n
'
)
rtt_file_lines
+=
1
tcpprobe_file
.
close
()
elif
file
[:
3
+
len
(
args
.
mask
)]
==
"bw_"
+
args
.
mask
:
elif
file
[:
3
+
len
(
args
.
mask
)]
==
"bw_"
+
args
.
mask
:
#black magic (create a bw value for each second)
bw_file
=
open
(
path
+
"/"
+
file
)
sum_b
=
0
last_bw
=
(
0
,
0
)
last_bw
=
(
1
,
0
)
for
line
in
bw_file
:
line
=
line
.
split
(
" "
)
this_bw
=
(
float
(
line
[
0
]),
float
(
line
[
3
]))
if
this_bw
[
0
]
<
math
.
ceil
(
last_bw
[
0
]):
if
this_bw
[
0
]
<
math
.
ceil
(
last_bw
[
0
]):
# still within same second
sum_b
+=
(
this_bw
[
0
]
-
last_bw
[
0
])
*
this_bw
[
1
]
elif
math
.
floor
(
this_bw
[
0
])
-
math
.
ceil
(
last_bw
[
0
])
>=
1
:
for
i
in
range
(
math
.
floor
(
this_bw
[
0
])
-
math
.
ceil
(
last_bw
[
0
])):
bw_values_file
.
write
(
"0"
+
"
\n
"
)
#print(math.floor(last_bw[0])+i,0)
sum_b
=
(
this_bw
[
0
]
-
math
.
floor
(
this_bw
[
0
]))
*
this_bw
[
1
]
else
:
# elif math.floor(this_bw[0]) - math.ceil(last_bw[0]) >= 1: #no value for more than a second, but we still want _something_
# sum_b += (math.ceil(last_bw[0]) - last_bw[0]) * float(line[3]
# bw_values_file.write(str(sum_b)+"\n")
# for i in range(math.floor(this_bw[0]) - math.ceil(last_bw[0])):
# #bw_values_file.write("0"+"\n")
# bw_values_file.write(str(this_bw[1])+"\n")
# #print(math.floor(last_bw[0])+i,0)
# sum_b = (this_bw[0] - math.floor(this_bw[0]))*this_bw[1]
else
:
#transition to a new second
sum_b
+=
(
math
.
ceil
(
last_bw
[
0
])
-
last_bw
[
0
])
*
float
(
line
[
3
])
bw_values_file
.
write
(
str
(
sum_b
)
+
"
\n
"
)
if
(
math
.
floor
(
this_bw
[
0
])
-
math
.
ceil
(
last_bw
[
0
])
>=
1
):
#if we skipped some seconds
for
i
in
range
(
math
.
floor
(
this_bw
[
0
])
-
math
.
ceil
(
last_bw
[
0
])):
# write the current bw (which should be the average)
bw_values_file
.
write
(
str
(
this_bw
[
1
])
+
"
\n
"
)
# for each missed second
#print(math.floor(last_bw[0]), sum_b)
sum_b
=
(
this_bw
[
0
]
-
math
.
floor
(
this_bw
[
0
]))
*
this_bw
[
1
]
last_bw
=
this_bw
if
int
(
last_bw
[
0
])
<
int
(
args
.
time
):
for
i
in
range
(
int
(
last_bw
[
0
]),
int
(
args
.
time
)):
bw_values_file
.
write
(
"0"
+
"
\n
"
)
#bw_values_file.write(line[3])
#bw_file_lines += 1
...
...
@@ -139,6 +149,8 @@ for folder in args.folders:
bw_values_file
.
seek
(
0
)
#print(bw_values_file.read())
#bw_values_file.seek(0)
rtt_values_file
.
seek
(
0
)
netperf_throughput_file
.
seek
(
0
)
netperf_retrans_file
.
seek
(
0
)
...
...
@@ -230,12 +242,12 @@ if len(sorted_netperf_retrans) == 1:
sorted_netperf_retrans
+=
sorted_netperf_retrans
sorted_netperf_retrans
=
statify_list
(
sorted_netperf_retrans
,
len
(
sorted_netperf_retrans
))
#
from pylab import *
from
pylab
import
*
#
boxplot(sorted_bw)
#
show()
#
boxplot(sorted_rtt)
#
show()
boxplot
(
sorted_bw
)
show
()
boxplot
(
sorted_rtt
)
show
()
#rtt_q_25 = quantil(sorted_rtt, 0.25)
#rtt_q_75 = quantil(sorted_rtt, 0.75)
...
...
wrapper.py
100644 → 100755
View file @
e40658f6
File mode changed from 100644 to 100755
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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