From: Brian Warner Date: Wed, 6 Feb 2008 09:12:35 +0000 (-0700) Subject: UploadResults: add more helper timing stats (ciphertext fetch times) X-Git-Tag: allmydata-tahoe-0.8.0~130 X-Git-Url: https://git.rkrishnan.org/specifications/index.php?a=commitdiff_plain;h=652d50d7e0bba69993da48c268f329c14935cdfb;p=tahoe-lafs%2Ftahoe-lafs.git UploadResults: add more helper timing stats (ciphertext fetch times) --- diff --git a/src/allmydata/offloaded.py b/src/allmydata/offloaded.py index 7f2a34f4..9561920a 100644 --- a/src/allmydata/offloaded.py +++ b/src/allmydata/offloaded.py @@ -196,6 +196,7 @@ class CHKUploadHelper(Referenceable, upload.CHKUploader): r.uri_extension_hash = uri_extension_hash f_times = self._fetcher.get_times() r.timings["cumulative_fetch"] = f_times["cumulative_fetch"] + r.ciphertext_fetched = self._fetcher.get_ciphertext_fetched() r.timings["total_fetch"] = f_times["total"] self._reader.close() os.unlink(self._encoding_file) @@ -258,6 +259,7 @@ class CHKCiphertextFetcher(AskUntilSuccessMixin): "cumulative_fetch": 0.0, "total": 0.0, } + self._ciphertext_fetched = 0 def log(self, *args, **kwargs): if "facility" not in kwargs: @@ -370,6 +372,7 @@ class CHKCiphertextFetcher(AskUntilSuccessMixin): for data in ciphertext_v: self._f.write(data) self._have += len(data) + self._ciphertext_fetched += len(data) return False # not done d.addCallback(_got_data) return d @@ -401,6 +404,9 @@ class CHKCiphertextFetcher(AskUntilSuccessMixin): def get_times(self): return self._times + def get_ciphertext_fetched(self): + return self._ciphertext_fetched + class LocalCiphertextReader(AskUntilSuccessMixin): implements(interfaces.IEncryptedUploadable) diff --git a/src/allmydata/upload.py b/src/allmydata/upload.py index 72b27faa..becf5b03 100644 --- a/src/allmydata/upload.py +++ b/src/allmydata/upload.py @@ -42,6 +42,7 @@ class UploadResults(Copyable, RemoteCopy): copytype = typeToCopy file_size = None + ciphertext_fetched = None # how much the helper fetched uri = None sharemap = None # dict of shnum to placement string servermap = None # dict of peerid to set(shnums) diff --git a/src/allmydata/web/unlinked-upload.xhtml b/src/allmydata/web/unlinked-upload.xhtml index eb4283a7..6265af65 100644 --- a/src/allmydata/web/unlinked-upload.xhtml +++ b/src/allmydata/web/unlinked-upload.xhtml @@ -24,6 +24,11 @@