$Id$
"""
-from zope.interface.exceptions import BrokenImplementation, DoesNotImplement
+from zope.interface.exceptions import DoesNotImplement
from zope.interface.exceptions import BrokenMethodImplementation
from types import FunctionType, MethodType
from zope.interface.interface import fromMethod, fromFunction, Method
avail = integer()
def upgradeSample1to2(old):
- total = 0
return old.upgradeVersion("diskwatcher_sample", 1, 2,
url=old.url,
when=old.when,
# used to discuss ticket #302: "stop permuting peerlist?"
-import time
+# import time
import math
-from hashlib import sha1, md5, sha256
+from hashlib import md5 # sha1, sha256
myhash = md5
# md5: 1520 "uploads" per second
# sha1: 1350 ups
def do_run(ring, opts):
avg_space_per_file = avg_filesize * opts["N"] / opts["k"]
fileseed = opts["fileseed"]
- start = time.time()
all_servers_have_room = True
no_files_have_wrapped = True
for filenum in count(0):
seed = opts["seed"]
ring = Ring(opts["servers"], seed, opts["permute"])
- num_files = do_run(ring, opts)
+ do_run(ring, opts)
def run(opts):
do_ring(opts)
return (True, tried)
def accept_share(self, fileid, sharesize):
- accept = False
if self.utilization < self.capacity:
# we have room! yay!
self.shares[fileid] = sharesize
def do_event(self):
time, etype = self.next.pop(0)
assert time > self.time
- current_time = self.time
+ # current_time = self.time
self.time = time
self._add_event(etype)
if etype == "ADDFILE":