Cleanup output just a little bit more.

This commit is contained in:
Wesley Spikes 2011-07-18 13:13:08 -07:00
parent 841b098619
commit 43b2f8695d
2 changed files with 6 additions and 6 deletions

View file

@ -9,6 +9,7 @@ from ..common import context, get_next_key
from ..common.results import TransferGreenletResult from ..common.results import TransferGreenletResult
from ..realistic import FileVerifier from ..realistic import FileVerifier
# Make sure context has somewhere to store what we need # Make sure context has somewhere to store what we need
context.update(bunch.Bunch( context.update(bunch.Bunch(
neads_first_read = collections.deque(), neads_first_read = collections.deque(),
@ -16,6 +17,7 @@ context.update(bunch.Bunch(
files_iter = None, files_iter = None,
)) ))
class SafeTransferGreenlet(gevent.Greenlet): class SafeTransferGreenlet(gevent.Greenlet):
def __init__(self, timeout=120): def __init__(self, timeout=120):
gevent.Greenlet.__init__(self) gevent.Greenlet.__init__(self)

View file

@ -25,8 +25,7 @@ class RandomContentFile(object):
) )
def _mark_chunk(self): def _mark_chunk(self):
ctime = time.time() self.chunks.append([self.offset, (time.time() - self.last_seek) * 1000000000])
self.chunks.append([self.offset, (ctime - self.last_seek) * 1000000000, ctime])
def seek(self, offset): def seek(self, offset):
assert offset == 0 assert offset == 0
@ -96,8 +95,7 @@ class FileVerifier(object):
self.chunks = [] self.chunks = []
def _mark_chunk(self): def _mark_chunk(self):
ctime = time.time() self.chunks.append([self.size, (time.time() - self.created_at) * 1000000000])
self.chunks.append([self.size, (ctime - self.created_at) * 1000000000, ctime])
def write(self, data): def write(self, data):
self.size += len(data) self.size += len(data)