]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Don't bother with fractional nanoseconds.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Tue, 26 Jul 2011 16:43:56 +0000 (09:43 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Tue, 26 Jul 2011 21:20:28 +0000 (14:20 -0700)
<1 nanosecond is well below the threshold we can measure,
everything becomes simpler with integers, and they're easier
to skim.

s3tests/realistic.py

index 2da8374dd5cb7195d060d4c5cd6d6dfcf4b48743..6857cf99d9cebe04db8ff7d0aeae6d88c2bfad4a 100644 (file)
@@ -23,7 +23,7 @@ class RandomContentFile(object):
         self.seek(0)
 
     def _mark_chunk(self):
-        self.chunks.append([self.offset, (time.time() - self.last_seek) * NANOSECOND])
+        self.chunks.append([self.offset, int(round((time.time() - self.last_seek) * NANOSECOND))])
 
     def seek(self, offset):
         assert offset == 0
@@ -93,7 +93,7 @@ class FileVerifier(object):
         self.chunks = []
 
     def _mark_chunk(self):
-        self.chunks.append([self.size, (time.time() - self.created_at) * NANOSECOND])
+        self.chunks.append([self.size, int(round((time.time() - self.created_at) * NANOSECOND))])
 
     def write(self, data):
         self.size += len(data)