Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodbtools
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
zodbtools
Commits
b4824ad5
Commit
b4824ad5
authored
Jan 08, 2019
by
Jérome Perrin
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
analyze: fix ZeroDivisionErrors when report is empty
parent
474a0559
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
zodbtools/test/test_analyze.py
zodbtools/test/test_analyze.py
+15
-0
zodbtools/zodbanalyze.py
zodbtools/zodbanalyze.py
+4
-3
No files found.
zodbtools/test/test_analyze.py
View file @
b4824ad5
...
...
@@ -56,3 +56,18 @@ __main__.Object,56,1880,54.366686%,33.571429,9,303,47,1577
==
captured
.
out
)
assert
captured
.
err
==
""
# empty range
report
(
analyze
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"testdata"
,
"1.fs"
),
use_dbm
=
False
,
delta_fs
=
False
,
tidmin
=
"ffffffffffffffff"
,
tidmax
=
None
,
),
csv
=
False
,
)
captured
=
capsys
.
readouterr
()
assert
"No transactions processed
\
n
"
==
captured
.
out
assert
captured
.
err
==
""
zodbtools/zodbanalyze.py
View file @
b4824ad5
...
...
@@ -95,9 +95,10 @@ def report(rep, csv=False):
delta_fs
=
rep
.
delta_fs
if
not
csv
:
if
rep
.
TIDS
==
0
:
print
"# ø"
else
:
print
"# %s..%s"
%
(
ashex
(
rep
.
tidmin
),
ashex
(
rep
.
tidmax
))
print
"No transactions processed"
return
print
"# %s..%s"
%
(
ashex
(
rep
.
tidmin
),
ashex
(
rep
.
tidmax
))
print
"Processed %d records in %d transactions"
%
(
rep
.
OIDS
,
rep
.
TIDS
)
print
"Average record size is %7.2f bytes"
%
(
rep
.
DBYTES
*
1.0
/
rep
.
OIDS
)
print
(
"Average transaction size is %7.2f bytes"
%
...
...
Kirill Smelkov
@kirr
mentioned in commit
65ebbe7b
·
Sep 07, 2022
mentioned in commit
65ebbe7b
mentioned in commit 65ebbe7bd7f14297eb1b43ea77f23efa948a93ac
Toggle commit list
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