Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CPUnetLOG
CPUnetPLOT
Commits
a3220d29
Commit
a3220d29
authored
Apr 14, 2017
by
Mario Hock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--sum
Summarize the data to plot (e.g., show total throughput)
parent
c29f66b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
cnl_file_plot.py
cnl_file_plot.py
+34
-2
No files found.
cnl_file_plot.py
View file @
a3220d29
...
...
@@ -82,9 +82,35 @@ def plot_net(ax, cnl_file, args):
ax
.
set_ylabel
(
'Throughput (Bit/s)'
)
ax
.
set_xlabel
(
'Time (s)'
)
cnl_plot
.
plot
(
ax
,
cnl_file
.
x_values
,
cnl_file
.
cols
,
cnl_file
.
net_col_names
,
cnl_file
.
net_col_labels
,
alpha
,
## * plot regular *
if
(
not
args
.
sum_only
):
# * plot regular *
cnl_plot
.
plot
(
ax
,
cnl_file
.
x_values
,
cnl_file
.
cols
,
cnl_file
.
net_col_names
,
cnl_file
.
net_col_labels
,
alpha
,
color
=
args
.
color
,
ema_only
=
True
if
smooth
else
False
,
smooth
=
smooth
)
# * plot summarized *
if
(
args
.
sum
or
args
.
sum_only
):
# summarize
sum
=
None
for
col_name
in
cnl_file
.
net_col_names
:
print
(
col_name
)
if
not
sum
:
sum
=
cnl_file
.
cols
[
col_name
]
else
:
sum
=
[
x
+
y
for
x
,
y
in
zip
(
sum
,
cnl_file
.
cols
[
col_name
])
]
# (just to be compatible with cnl_plot.plot)
aux_col_dict
=
dict
()
aux_col_dict
[
"sum"
]
=
sum
# * plot *
cnl_plot
.
plot
(
ax
,
cnl_file
.
x_values
,
aux_col_dict
,
[
"sum"
],
[
"Total"
],
alpha
,
color
=
args
.
color
,
ema_only
=
True
if
smooth
else
False
,
smooth
=
smooth
)
# Legend
if
(
args
.
legend_pos
!=
None
):
if
(
legend_outside
):
...
...
@@ -225,7 +251,7 @@ if __name__ == "__main__":
DEFAULT_OPACITY
=
0.7
DEFAULT_ALPHA
=
0.1
# alpha for ema, the smaller the smoother
DEFAULT_Y_RANGE
=
1
# Gbit/s
DEFAULT_Y_RANGE
=
1
0
# Gbit/s
DEFAULT_X_MIN
=
-
5.0
DEFAULT_X_MAX
=
None
...
...
@@ -276,6 +302,12 @@ if __name__ == "__main__":
help
=
"Do NOT use a common base time, but begin every line at 0. (Do not in conjunction with --reference-files)"
)
parser
.
add_argument
(
"--sum"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Summarizes the values of the given streams (show total throughput as one line). Please make sure to select the connect NICs and send/receive direction."
)
parser
.
add_argument
(
"--sum-only"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Hide individual lines (use together with --sum."
)
## make it pretty
parser
.
add_argument
(
"--x-min"
,
type
=
float
,
default
=
DEFAULT_X_MIN
)
...
...
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