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
366414ae
Commit
366414ae
authored
Mar 13, 2013
by
Albertas Agejevas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stats tests. Need random2.
parent
4d9871f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
setup.py
setup.py
+1
-1
src/ZEO/scripts/cache_simul.py
src/ZEO/scripts/cache_simul.py
+1
-1
src/ZEO/scripts/cache_stats.py
src/ZEO/scripts/cache_stats.py
+3
-5
src/ZEO/tests/test_cache.py
src/ZEO/tests/test_cache.py
+2
-2
No files found.
setup.py
View file @
366414ae
...
...
@@ -71,7 +71,7 @@ def alltests():
suite
.
addTest
(
mod
.
test_suite
())
return
suite
tests_require
=
[
'zope.testing'
,
'manuel'
]
tests_require
=
[
'zope.testing'
,
'manuel'
,
'random2'
]
long_description
=
(
open
(
'README.txt'
).
read
()
...
...
src/ZEO/scripts/cache_simul.py
View file @
366414ae
...
...
@@ -154,7 +154,7 @@ def main(args=None):
code
&
0x80
,
code
&
0x7e
)
# And pass it to the simulation.
this_interval
=
int
(
ts
)
/
interval_step
this_interval
=
int
(
ts
)
//
interval_step
if
this_interval
!=
last_interval
:
if
last_interval
is
not
None
:
interval_sim
.
report
()
...
...
src/ZEO/scripts/cache_stats.py
View file @
366414ae
...
...
@@ -298,8 +298,7 @@ def dumpbysize(bysize, how, how2):
print
()
print
(
"Unique sizes %s: %s"
%
(
how
,
addcommas
(
len
(
bysize
))))
print
(
"%10s %6s %6s"
%
(
"size"
,
"objs"
,
how2
))
sizes
=
bysize
.
keys
()
sizes
.
sort
()
sizes
=
sorted
(
bysize
.
keys
())
for
size
in
sizes
:
loads
=
0
for
n
in
six
.
itervalues
(
bysize
[
size
]):
...
...
@@ -348,15 +347,14 @@ def histogram(d):
bins
=
{}
for
v
in
six
.
itervalues
(
d
):
bins
[
v
]
=
bins
.
get
(
v
,
0
)
+
1
L
=
bins
.
items
()
L
.
sort
()
L
=
sorted
(
bins
.
items
())
return
L
def
U64
(
s
):
return
struct
.
unpack
(
">Q"
,
s
)[
0
]
def
oid_repr
(
oid
):
if
isinstance
(
oid
,
s
tr
)
and
len
(
oid
)
==
8
:
if
isinstance
(
oid
,
s
ix
.
binary_type
)
and
len
(
oid
)
==
8
:
return
'%16x'
%
U64
(
oid
)
else
:
return
repr
(
oid
)
...
...
src/ZEO/tests/test_cache.py
View file @
366414ae
...
...
@@ -424,7 +424,7 @@ def thread_safe():
>>> for i in range(100):
... cache.store(ZODB.utils.p64(i), ZODB.utils.p64(1), None, b'0')
>>> import random, sys, threading
>>> import random
2 as random
, sys, threading
>>> random = random.Random(0)
>>> stop = False
>>> read_failure = None
...
...
@@ -512,7 +512,7 @@ Check to make sure the cache analysis scripts work.
>>> time.time = lambda : now
>>> os.environ["ZEO_CACHE_TRACE"] = 'yes'
>>> import random
>>> import random
2 as random
>>> random = random.Random(42)
>>> history = []
>>> serial = 1
...
...
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