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
Show 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():
...
@@ -71,7 +71,7 @@ def alltests():
suite
.
addTest
(
mod
.
test_suite
())
suite
.
addTest
(
mod
.
test_suite
())
return
suite
return
suite
tests_require
=
[
'zope.testing'
,
'manuel'
]
tests_require
=
[
'zope.testing'
,
'manuel'
,
'random2'
]
long_description
=
(
long_description
=
(
open
(
'README.txt'
).
read
()
open
(
'README.txt'
).
read
()
...
...
src/ZEO/scripts/cache_simul.py
View file @
366414ae
...
@@ -154,7 +154,7 @@ def main(args=None):
...
@@ -154,7 +154,7 @@ def main(args=None):
code
&
0x80
,
code
&
0x80
,
code
&
0x7e
)
code
&
0x7e
)
# And pass it to the simulation.
# And pass it to the simulation.
this_interval
=
int
(
ts
)
/
interval_step
this_interval
=
int
(
ts
)
//
interval_step
if
this_interval
!=
last_interval
:
if
this_interval
!=
last_interval
:
if
last_interval
is
not
None
:
if
last_interval
is
not
None
:
interval_sim
.
report
()
interval_sim
.
report
()
...
...
src/ZEO/scripts/cache_stats.py
View file @
366414ae
...
@@ -298,8 +298,7 @@ def dumpbysize(bysize, how, how2):
...
@@ -298,8 +298,7 @@ def dumpbysize(bysize, how, how2):
print
()
print
()
print
(
"Unique sizes %s: %s"
%
(
how
,
addcommas
(
len
(
bysize
))))
print
(
"Unique sizes %s: %s"
%
(
how
,
addcommas
(
len
(
bysize
))))
print
(
"%10s %6s %6s"
%
(
"size"
,
"objs"
,
how2
))
print
(
"%10s %6s %6s"
%
(
"size"
,
"objs"
,
how2
))
sizes
=
bysize
.
keys
()
sizes
=
sorted
(
bysize
.
keys
())
sizes
.
sort
()
for
size
in
sizes
:
for
size
in
sizes
:
loads
=
0
loads
=
0
for
n
in
six
.
itervalues
(
bysize
[
size
]):
for
n
in
six
.
itervalues
(
bysize
[
size
]):
...
@@ -348,15 +347,14 @@ def histogram(d):
...
@@ -348,15 +347,14 @@ def histogram(d):
bins
=
{}
bins
=
{}
for
v
in
six
.
itervalues
(
d
):
for
v
in
six
.
itervalues
(
d
):
bins
[
v
]
=
bins
.
get
(
v
,
0
)
+
1
bins
[
v
]
=
bins
.
get
(
v
,
0
)
+
1
L
=
bins
.
items
()
L
=
sorted
(
bins
.
items
())
L
.
sort
()
return
L
return
L
def
U64
(
s
):
def
U64
(
s
):
return
struct
.
unpack
(
">Q"
,
s
)[
0
]
return
struct
.
unpack
(
">Q"
,
s
)[
0
]
def
oid_repr
(
oid
):
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
)
return
'%16x'
%
U64
(
oid
)
else
:
else
:
return
repr
(
oid
)
return
repr
(
oid
)
...
...
src/ZEO/tests/test_cache.py
View file @
366414ae
...
@@ -424,7 +424,7 @@ def thread_safe():
...
@@ -424,7 +424,7 @@ def thread_safe():
>>> for i in range(100):
>>> for i in range(100):
... cache.store(ZODB.utils.p64(i), ZODB.utils.p64(1), None, b'0')
... 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)
>>> random = random.Random(0)
>>> stop = False
>>> stop = False
>>> read_failure = None
>>> read_failure = None
...
@@ -512,7 +512,7 @@ Check to make sure the cache analysis scripts work.
...
@@ -512,7 +512,7 @@ Check to make sure the cache analysis scripts work.
>>> time.time = lambda : now
>>> time.time = lambda : now
>>> os.environ["ZEO_CACHE_TRACE"] = 'yes'
>>> os.environ["ZEO_CACHE_TRACE"] = 'yes'
>>> import random
>>> import random
2 as random
>>> random = random.Random(42)
>>> random = random.Random(42)
>>> history = []
>>> history = []
>>> serial = 1
>>> 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