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
Joshua
zodb
Commits
8927a15e
Commit
8927a15e
authored
Sep 08, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more precision to the percentages; make %cum add up to 100%.
parent
266ebdac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/ZEO/stats.py
src/ZEO/stats.py
+5
-6
No files found.
src/ZEO/stats.py
View file @
8927a15e
...
...
@@ -229,18 +229,17 @@ def main():
print
print
"Histogram of object load frequency"
total
=
len
(
oids
)
s
=
addcommas
(
total
)
print
"Unique oids: %s"
%
addcommas
(
total
)
print
"Total loads: %s"
%
addcommas
(
total_loads
)
s
=
addcommas
(
total
)
width
=
max
(
len
(
s
),
len
(
"objects"
))
fmt
=
"%5d %"
+
str
(
width
)
+
"s %
3d%% %5.1f%% %4d
%%"
hdr
=
"%5s %"
+
str
(
width
)
+
"s %
4s %6s %5
s"
fmt
=
"%5d %"
+
str
(
width
)
+
"s %
5.1f%% %5.1f%% %5.1f
%%"
hdr
=
"%5s %"
+
str
(
width
)
+
"s %
6s %6s %6
s"
print
hdr
%
(
"loads"
,
"objects"
,
"%obj"
,
"%load"
,
"%cum"
)
cum
=
0.0
for
binsize
,
count
in
histogram
(
oids
):
obj_percent
=
100
*
count
/
total
load_percent
=
1000
*
count
*
binsize
/
total_loads
load_percent
/=
10.
obj_percent
=
100.0
*
count
/
total
load_percent
=
100.0
*
count
*
binsize
/
total_loads
cum
+=
load_percent
print
fmt
%
(
binsize
,
addcommas
(
count
),
obj_percent
,
load_percent
,
cum
)
...
...
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