Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
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
nexedi
tsn-measures
Commits
1a06b0f0
Commit
1a06b0f0
authored
Jun 10, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix interval option not being present in txtime and run_server scripts
parent
551e86c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
scripts/run_server
scripts/run_server
+8
-4
scripts/txtime_stats.py
scripts/txtime_stats.py
+15
-9
No files found.
scripts/run_server
View file @
1a06b0f0
...
@@ -3,15 +3,16 @@
...
@@ -3,15 +3,16 @@
script_dir
=
$(
dirname
$(
realpath
$0
))
script_dir
=
$(
dirname
$(
realpath
$0
))
usage
()
{
usage
()
{
echo
"Usage:
$0
[[-bt] [-g INTERVAL]] |
-d NB_PACKETS]
"
1>&2
;
echo
"Usage:
$0
[[-bt] [-g INTERVAL]] |
(-d NB_PACKETS [-i INTERVAL])
"
1>&2
;
exit
1
;
exit
1
;
}
}
# Default options
# Default options
server_options
=
"-a -p 99 -f eth0"
server_options
=
"-a -p 99 -f eth0"
ip
=
"192.168.99."
ip
=
"192.168.99."
tcpdump_interval
=
1000000
while
getopts
"b:htd:g:"
opt
;
do
while
getopts
"b:htd:
i:
g:"
opt
;
do
case
"
${
opt
}
"
in
case
"
${
opt
}
"
in
b
)
b
)
use_rtt
=
1
use_rtt
=
1
...
@@ -21,6 +22,9 @@ while getopts "b:htd:g:" opt; do
...
@@ -21,6 +22,9 @@ while getopts "b:htd:g:" opt; do
use_tcpdump
=
1
use_tcpdump
=
1
nb_packets
=
${
OPTARG
}
nb_packets
=
${
OPTARG
}
;;
;;
i
)
tcpdump_interval
=
${
OPTARG
}
;;
g
)
g
)
interval
=
${
OPTARG
}
interval
=
${
OPTARG
}
server_options+
=
" -g -i
$interval
"
server_options+
=
" -g -i
$interval
"
...
@@ -69,8 +73,8 @@ if [ -n "${use_tcpdump}" ]; then
...
@@ -69,8 +73,8 @@ if [ -n "${use_tcpdump}" ]; then
echo
"tshark -r tmp.pcap --disable-protocol dcp-etsi --disable-protocol dcp-pft -t e -E separator=, -T fields -e frame.number -e frame.time_epoch -e data.data > tmp.out"
;
echo
"tshark -r tmp.pcap --disable-protocol dcp-etsi --disable-protocol dcp-pft -t e -E separator=, -T fields -e frame.number -e frame.time_epoch -e data.data > tmp.out"
;
tshark
-r
server_stats_tmp.pcap
--disable-protocol
dcp-etsi
--disable-protocol
dcp-pft
-t
e
-E
separator
=
,
-T
fields
-e
frame.number
-e
frame.time_epoch
-e
data.data
>
server_stats_tmp.out
;
tshark
-r
server_stats_tmp.pcap
--disable-protocol
dcp-etsi
--disable-protocol
dcp-pft
-t
e
-E
separator
=
,
-T
fields
-e
frame.number
-e
frame.time_epoch
-e
data.data
>
server_stats_tmp.out
;
echo
"txtime_stats.py -f server_pcap_stats"
;
echo
"txtime_stats.py -f server_pcap_stats
-i
$tcpdump_interval
"
;
$script_dir
/txtime_stats.py
-f
server_stats_tmp.out
;
$script_dir
/txtime_stats.py
-f
server_stats_tmp.out
-i
$tcpdump_interval
;
else
else
echo
"make server"
;
echo
"make server"
;
...
...
scripts/txtime_stats.py
View file @
1a06b0f0
...
@@ -27,7 +27,7 @@ import struct
...
@@ -27,7 +27,7 @@ import struct
import
math
import
math
import
sys
import
sys
def
compute_offsets_stats
(
file_path
):
def
compute_offsets_stats
(
file_path
,
interval
):
measure_set
=
{}
measure_set
=
{}
measure_set
[
"measure_type"
]
=
"packet_jitter_tcpdump"
measure_set
[
"measure_type"
]
=
"packet_jitter_tcpdump"
...
@@ -55,7 +55,7 @@ def compute_offsets_stats(file_path):
...
@@ -55,7 +55,7 @@ def compute_offsets_stats(file_path):
if
histogram_index
<
0
or
histogram_index
>
2000
:
if
histogram_index
<
0
or
histogram_index
>
2000
:
print
(
"jitter too high: {}
\
n
"
.
format
(
jitter
))
print
(
"jitter too high: {}
\
n
"
.
format
(
jitter
))
else
:
else
:
histogram
[
histogram_index
]
++
histogram
[
histogram_index
]
+=
1
# Update statistics.
# Update statistics.
min_t
=
jitter
if
jitter
<
min_t
else
min_t
min_t
=
jitter
if
jitter
<
min_t
else
min_t
...
@@ -79,17 +79,23 @@ def compute_offsets_stats(file_path):
...
@@ -79,17 +79,23 @@ def compute_offsets_stats(file_path):
def
main
():
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
parser
.
add_argument
(
'-f'
,
dest
=
'file_path'
,
default
=
None
,
type
=
str
,
'-f'
,
dest
=
'file_path'
,
default
=
None
,
type
=
str
,
help
=
'Path to input file (e.g. DATA.out) generated by tshark with:
\
help
=
'Path to input file (e.g. DATA.out) generated by tshark with:
\
tshark -r CAPTURE.pcap -t e -E separator=, -T
\
tshark -r CAPTURE.pcap -t e -E separator=, -T
\
fields -e frame.number -e frame.time_epoch
\
fields -e frame.number -e frame.time_epoch
\
-e data.data > DATA.out'
)
-e data.data > DATA.out'
)
parser
.
add_argument
(
'-i'
,
nargs
=
1
,
required
=
False
,
help
=
'Indicate which interval was used'
)
# Default interval
interval
=
1000000
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
i
is
not
None
:
interval
=
args
.
i
[
0
]
if
args
.
file_path
is
not
None
:
if
args
.
file_path
is
not
None
:
compute_offsets_stats
(
args
.
file_path
)
compute_offsets_stats
(
args
.
file_path
,
interval
)
else
:
else
:
parser
.
print_help
()
parser
.
print_help
()
...
...
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