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
2c22c7d9
Commit
2c22c7d9
authored
9 years ago
by
Simon Désaulniers
Browse files
Options
Downloads
Patches
Plain Diff
more code refactoring
parent
6c3c19c0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tools/benchmark.py
+148
-161
148 additions, 161 deletions
python/tools/benchmark.py
with
148 additions
and
161 deletions
python/tools/benchmark.py
+
148
−
161
View file @
2c22c7d9
...
...
@@ -462,12 +462,17 @@ class PersistenceTest(FeatureTest):
DhtNetwork
.
log
(
"
Values didn
'
t reach new hosting nodes after shutdown.
"
)
def
run
(
self
):
try
:
if
self
.
_test
==
'
delete
'
:
self
.
_deleteTest
()
elif
self
.
_test
==
'
replace
'
:
self
.
_resplaceClusterTest
()
elif
self
.
_test
==
'
mult_time
'
:
self
.
_multTimeTest
()
except
Exception
as
e
:
print
(
e
)
finally
:
bootstrap
.
resize
(
1
)
#-----------
#- Tests -
...
...
@@ -487,7 +492,6 @@ class PersistenceTest(FeatureTest):
ops_count
=
[]
try
:
bootstrap
.
resize
(
3
)
consumer
=
bootstrap
.
get
(
1
)
producer
=
bootstrap
.
get
(
2
)
...
...
@@ -547,11 +551,6 @@ class PersistenceTest(FeatureTest):
else
:
DhtNetwork
.
log
(
"
[GET]: either couldn
'
t fetch values or nodes hosting values...
"
)
except
Exception
as
e
:
print
(
e
)
finally
:
bootstrap
.
resize
(
1
)
def
_resplaceClusterTest
(
self
):
"""
It replaces all clusters one after the other.
...
...
@@ -565,7 +564,6 @@ class PersistenceTest(FeatureTest):
bootstrap
=
self
.
bootstrap
try
:
bootstrap
.
resize
(
3
)
consumer
=
bootstrap
.
get
(
1
)
producer
=
bootstrap
.
get
(
2
)
...
...
@@ -592,11 +590,6 @@ class PersistenceTest(FeatureTest):
self
.
_result
(
local_values
,
new_nodes
)
except
Exception
as
e
:
print
(
e
)
finally
:
bootstrap
.
resize
(
1
)
def
_multTimeTest
(
self
):
"""
Multiple put() calls are made from multiple nodes to multiple hashes
...
...
@@ -642,7 +635,6 @@ class PersistenceTest(FeatureTest):
str
(
self
.
bootstrap
.
port
))
flood_nodes
.
append
(
n
)
try
:
bootstrap
.
resize
(
N_PRODUCERS
+
2
)
consumer
=
bootstrap
.
get
(
1
)
producers
=
(
bootstrap
.
get
(
n
)
for
n
in
range
(
2
,
N_PRODUCERS
+
2
))
...
...
@@ -679,11 +671,6 @@ class PersistenceTest(FeatureTest):
gottaGetThemAllPokeNodes
(
nodes
=
nodes_after_time
)
self
.
_result
(
values
,
nodes_after_time
-
nodes
)
except
Exception
as
e
:
print
(
e
)
finally
:
bootstrap
.
resize
(
1
)
class
PerformanceTest
(
FeatureTest
):
"""
Tests for general performance of dht operations.
...
...
@@ -701,10 +688,16 @@ class PerformanceTest(FeatureTest):
super
(
PerformanceTest
,
self
).
__init__
(
test
,
workbench
)
def
run
(
self
):
try
:
if
self
.
_test
==
'
gets
'
:
self
.
_getsTimesTest
()
elif
self
.
_test
==
'
delete
'
:
self
.
_delete
()
except
Exception
as
e
:
print
(
e
)
finally
:
self
.
bootstrap
.
resize
(
1
)
###########
# Tests #
...
...
@@ -806,7 +799,6 @@ class PerformanceTest(FeatureTest):
bootstrap
=
self
.
bootstrap
try
:
bootstrap
.
resize
(
3
)
consumer
=
bootstrap
.
get
(
1
)
producer
=
bootstrap
.
get
(
2
)
...
...
@@ -842,11 +834,6 @@ class PerformanceTest(FeatureTest):
FeatureTest
.
foreign_nodes
)
except
Exception
as
e
:
print
(
e
)
finally
:
bootstrap
.
resize
(
1
)
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
(
description
=
'
Run, test and benchmark a
'
\
...
...
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