projects
/
cumulus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
81b1c38
)
Include segment add/remove counts in list-snapshot-sizes.
author
Michael Vrable
<mvrable@cs.ucsd.edu>
Wed, 14 Jan 2009 22:06:31 +0000
(14:06 -0800)
committer
Michael Vrable
<mvrable@turin.ucsd.edu>
Wed, 14 Jan 2009 22:06:31 +0000
(14:06 -0800)
cumulus-util
patch
|
blob
|
history
diff --git
a/cumulus-util
b/cumulus-util
index
ce80ff6
..
6bb4749
100755
(executable)
--- a/
cumulus-util
+++ b/
cumulus-util
@@
-96,16
+96,19
@@
def cmd_list_snapshot_sizes():
intent = 1.0
segments = d['Segments'].split()
intent = 1.0
segments = d['Segments'].split()
- (size, added, removed
) = (
0, 0, 0)
+ (size, added, removed
, addcount, remcount) = (0, 0,
0, 0, 0)
for seg in segments:
segsize = lowlevel.lowlevel_stat(seg + ".tar.gpg")['size']
size += segsize
for seg in segments:
segsize = lowlevel.lowlevel_stat(seg + ".tar.gpg")['size']
size += segsize
- if seg not in previous: added += segsize
+ if seg not in previous:
+ added += segsize
+ addcount += 1
for seg in previous:
if seg not in segments:
removed += lowlevel.lowlevel_stat(seg + ".tar.gpg")['size']
for seg in previous:
if seg not in segments:
removed += lowlevel.lowlevel_stat(seg + ".tar.gpg")['size']
+ remcount += 1
previous = set(segments)
previous = set(segments)
- print "%s [%s]: %.3f +%.3f -%.3f
" % (s, intent, size / 1024.0**2, added / 1024.0**2, removed / 1024.0**2
)
+ print "%s [%s]: %.3f +%.3f -%.3f
(+%d/-%d segments)" % (s, intent, size / 1024.0**2, added / 1024.0**2, removed / 1024.0**2, addcount, remcount
)
# Build checksum list for objects in the given segments, or all segments if
# none are specified.
# Build checksum list for objects in the given segments, or all segments if
# none are specified.