Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
0f5086fe
Commit
0f5086fe
authored
9 years ago
by
Simon Désaulniers
Browse files
Options
Downloads
Patches
Plain Diff
benchmark: toggling bootstrap dht log USR1 signal
parent
b7004f60
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tools/benchmark.py
+15
-5
15 additions, 5 deletions
python/tools/benchmark.py
with
15 additions
and
5 deletions
python/tools/benchmark.py
+
15
−
5
View file @
0f5086fe
...
...
@@ -132,7 +132,6 @@ class WorkBench():
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
(
description
=
'
Run, test and benchmark a
'
\
'
DHT network on a local virtual network with simulated packet
'
\
'
loss and latency.
'
)
...
...
@@ -165,19 +164,30 @@ if __name__ == '__main__':
'
Use
"
-m
"
to specify the number of producers on the DHT.
'
\
'
Use
"
-e
"
to specify the number of values to put on the DHT.
'
)
args
=
parser
.
parse_args
()
test_opt
=
{
o
:
True
for
o
in
args
.
opt
}
wb
=
WorkBench
(
args
.
ifname
,
args
.
virtual_locs
,
args
.
node_num
,
loss
=
args
.
loss
,
delay
=
args
.
delay
,
disable_ipv4
=
args
.
disable_ipv4
,
disable_ipv6
=
args
.
disable_ipv6
)
wb
.
create_virtual_net
()
bootstrap
=
wb
.
get_bootstrap
()
bs_dht_log_enabled
=
False
def
toggle_bs_dht_log
(
signum
,
frame
):
global
bs_dht_log_enabled
,
bootstrap
if
bs_dht_log_enabled
:
bootstrap
.
front
().
disableLogging
()
bs_dht_log_enabled
=
False
else
:
bootstrap
.
front
().
enableLogging
()
bs_dht_log_enabled
=
True
signal
.
signal
(
signal
.
SIGUSR1
,
toggle_bs_dht_log
)
if
args
.
bs_dht_log
:
bootstrap
.
enableLogging
()
bs_dht_log_enabled
=
True
bootstrap
.
front
().
enableLogging
()
wb
.
create_virtual_net
()
bootstrap
.
resize
(
1
)
print
(
"
Launching
"
,
wb
.
node_num
,
"
nodes (
"
,
wb
.
clusters
,
"
clusters of
"
,
wb
.
node_per_loc
,
"
nodes)
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment