Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
744ed090
Commit
744ed090
authored
Sep 05, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report hit rate for load requests.
parent
f8e54a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/ZEO/stats.py
src/ZEO/stats.py
+15
-0
No files found.
src/ZEO/stats.py
View file @
744ed090
...
...
@@ -148,6 +148,7 @@ def main():
addcommas
(
datarecords
),
100.0
*
datarecords
/
records
,
datasize
/
1024.0
/
datarecords
)
print
"Hit rate: %.1f%% (load hits / loads)"
%
hitrate
(
bycode
)
print
codes
=
bycode
.
keys
()
codes
.
sort
()
...
...
@@ -158,6 +159,20 @@ def main():
code
,
explain
.
get
(
code
)
or
"*** unknown code ***"
)
def
hitrate
(
bycode
):
loads
=
0
hits
=
0
for
code
in
bycode
.
keys
():
if
code
&
0x70
==
0x20
:
n
=
bycode
[
code
]
loads
+=
n
if
code
in
(
0x2A
,
0x2C
,
0x2E
):
hits
+=
n
if
loads
:
return
100.0
*
hits
/
loads
else
:
return
0.0
def
U64
(
s
):
h
,
v
=
struct
.
unpack
(
">II"
,
s
)
return
(
long
(
h
)
<<
32
)
+
v
...
...
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