Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
b459aaa9
Commit
b459aaa9
authored
May 08, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print mean, min, and max for summary.
Also print # conflicts for each test (appears to be zero).
parent
12dba8b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
src/ZEO/tests/speed.py
src/ZEO/tests/speed.py
+17
-7
No files found.
src/ZEO/tests/speed.py
View file @
b459aaa9
...
...
@@ -151,6 +151,7 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
for
j
in
range
(
nrep
):
for
r
in
1
,
10
,
100
,
1000
:
t
=
time
.
time
()
conflicts
=
0
jar
=
db
.
open
()
while
1
:
...
...
@@ -171,7 +172,7 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
setattr
(
p
,
str
(
i
),
v
)
get_transaction
().
commit
()
except
ConflictError
:
pass
conflicts
=
conflicts
+
1
else
:
break
jar
.
close
()
...
...
@@ -179,10 +180,11 @@ def work(db, results, nrep, compress, data, detailed, minimize, threadno=None):
t
=
time
.
time
()
-
t
if
detailed
:
if
threadno
is
None
:
print
"%s
\
t
%s
\
t
%.4f
"
%
(
j
,
r
,
t
)
print
"%s
\
t
%s
\
t
%.4f
\
t
%d"
%
(
j
,
r
,
t
,
conflicts
)
else
:
print
"%s
\
t
%s
\
t
%.4f
\
t
%d"
%
(
j
,
r
,
t
,
threadno
)
results
[
r
]
=
results
[
r
]
+
t
print
"%s
\
t
%s
\
t
%.4f
\
t
%d
\
t
%d"
%
(
j
,
r
,
t
,
conflicts
,
threadno
)
results
[
r
].
append
((
t
,
conflicts
))
rt
=
d
=
p
=
v
=
None
# release all references
if
minimize
:
time
.
sleep
(
3
)
...
...
@@ -238,7 +240,7 @@ def main(args):
cache_deactivate_after
=
6000
,)
print
"Beginning work..."
results
=
{
1
:
0
,
10
:
0
,
100
:
0
,
1000
:
0
}
results
=
{
1
:
[],
10
:[],
100
:[],
1000
:[]
}
if
threads
>
1
:
import
threading
l
=
[
threading
.
Thread
(
target
=
work
,
...
...
@@ -259,9 +261,17 @@ def main(args):
if
detailed
:
print
'-'
*
24
print
"num
\
t
mean
\
t
min
\
t
max"
for
r
in
1
,
10
,
100
,
1000
:
t
=
results
[
r
]
/
(
nrep
*
threads
)
print
"mean:
\
t
%s
\
t
%.4f
\
t
%.4f (s/o)"
%
(
r
,
t
,
t
/
r
)
times
=
[
time
for
time
,
conf
in
results
[
r
]]
t
=
mean
(
times
)
print
"%d
\
t
%.4f
\
t
%.4f
\
t
%.4f"
%
(
r
,
t
,
min
(
times
),
max
(
times
))
def
mean
(
l
):
tot
=
0
for
v
in
l
:
tot
=
tot
+
v
return
tot
/
len
(
l
)
##def compress(s):
## c = zlib.compressobj()
...
...
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