Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
s_doering
asteriskperf-python-wrapper
Commits
eb74803f
Commit
eb74803f
authored
Jul 11, 2015
by
Deathcrow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor optimizations
parent
62f109f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
wrapper.py
wrapper.py
+16
-14
No files found.
wrapper.py
View file @
eb74803f
...
...
@@ -92,10 +92,10 @@ def process_proc_tcpprobe(sender): #sampling
# write time + current tcpprobe line to file for this sender
unprocessed_senders
.
pop
(
key
)[
'tcpprobe_file'
].
write
(
str
(
time_dif
)
+
" "
+
" "
.
join
(
line_split
[
1
:]))
break
else
:
# no break occured
if
line
==
""
:
# this shouldn't happen. Try to continue anyway
print
(
"CRITICAL ERROR!"
)
unprocessed_senders
=
{}
else
:
# no break occured
if
line
==
""
:
# this shouldn't happen. Try to continue anyway
print
(
"CRITICAL ERROR!"
)
unprocessed_senders
=
{}
tcpprobe_proc
.
close
()
...
...
@@ -200,29 +200,31 @@ if args.tcpdump == "1":
tcpdump
=
subprocess
.
Popen
([
"tcpdump"
,
"-iany"
,
"-w"
+
args
.
tmp_folder
+
"/tcpdump_"
+
str
(
mypid
),
"-s100"
])
# if congesion_algo == all check proc and do all
#
TODO?
if congesion_algo == all check proc and do all
#setup done, run tests
start_time
=
time
.
perf_counter
()
for
key
,
i
in
enumerate
(
sender
):
utility_command
=
[
args
.
utility
,
\
i
[
'
utility_command
'
]
=
[
args
.
utility
,
\
utility_args
[
'connect'
],
i
[
'dst'
],
\
utility_args
[
'bind'
],
i
[
'src'
]
,
\
utility_args
[
'time'
],
args
.
time
,
\
utility_args
[
'port'
],
args
.
port
,
\
utility_args
[
'ipv6'
]
]
if
args
.
utility
==
"netperf"
:
utility_command
+=
[
"--"
,
"-k"
,
"all"
,
"-P"
,
i
[
'src_port'
]
]
utility_command
+=
[
utility_args
[
'congestion'
],
i
[
'congestion'
]
]
i
[
'
utility_command
'
]
+=
[
"--"
,
"-k"
,
"all"
,
"-P"
,
i
[
'src_port'
]
]
i
[
'
utility_command
'
]
+=
[
utility_args
[
'congestion'
],
i
[
'congestion'
]
]
if
args
.
no_delay
:
utility_command
+=
[
utility_args
[
'no_delay'
]
]
i
[
'
utility_command
'
]
+=
[
utility_args
[
'no_delay'
]
]
i
[
'utility_file'
]
=
open
(
args
.
tmp_folder
+
"/"
+
args
.
utility
+
"_"
+
i
[
'congestion'
]
+
"_"
+
str
(
key
),
'w+'
)
i
[
'utility'
]
=
subprocess
.
Popen
(
utility_command
,
stdout
=
i
[
'utility_file'
])
print
(
i
[
'utility'
].
args
)
print
(
i
[
'src'
]
+
":"
+
i
[
'src_port'
]
+
" "
+
i
[
'dst'
]
+
":"
+
i
[
'port'
])
# print(i['src']+":"+i['src_port']+" "+i['dst']+":"+i['port'])
#setup done, run tests
start_time
=
time
.
perf_counter
()
for
key
,
i
in
enumerate
(
sender
):
i
[
'utility'
]
=
subprocess
.
Popen
(
i
[
'utility_command'
],
stdout
=
i
[
'utility_file'
])
print
(
i
[
'utility'
].
args
)
if
args
.
utility
!=
"netperf"
:
ss_file
=
tempfile
.
TemporaryFile
(
mode
=
'r+'
)
...
...
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