From: Brian Warner Date: Thu, 30 Nov 2006 22:14:39 +0000 (-0700) Subject: some pointless fussing about with sizes.py X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~547 X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/-?a=commitdiff_plain;h=36969e964bc45b1cc3dea0b62e728988a48177fa;p=tahoe-lafs%2Ftahoe-lafs.git some pointless fussing about with sizes.py --- diff --git a/sizes.py b/sizes.py index 39d83928..6e251989 100644 --- a/sizes.py +++ b/sizes.py @@ -37,7 +37,7 @@ PiB=1024*TiB class Sizes: def __init__(self, mode, file_size, arity=2): - MAX_SEGSIZE = 1*MiB + MAX_SEGSIZE = 2*MiB self.mode = mode self.file_size = file_size self.seg_size = seg_size = 1.0 * min(MAX_SEGSIZE, file_size) @@ -132,7 +132,8 @@ class Sizes: def fmt(num, trim=False): if num < KiB: - s = str(num) + "#" + #s = str(num) + "#" + s = "%.2f#" % num elif num < MiB: s = "%.2fk" % (num / KiB) elif num < GiB: @@ -166,7 +167,12 @@ def text(): print "Size blocksize overhead overhead k d alacrity" print " (bytes) (%)" print "------- ------- -------- -------- ---- -- --------" - sizes = [2 ** i for i in range(7, 41)] + #sizes = [2 ** i for i in range(7, 41)] + radix = math.sqrt(10); expstep = 2 + radix = 2; expstep = 2 + #radix = 10; expstep = 1 + maxexp = int(math.ceil(math.log(1e12, radix)))+2 + sizes = [radix ** i for i in range(2,maxexp,expstep)] for file_size in sizes: s = Sizes(mode, file_size, arity) out = ""