From: Brian Warner Date: Wed, 6 Feb 2008 09:39:01 +0000 (-0700) Subject: webish: more upload stats: total encode-and-push rate, already-in-grid existence... X-Git-Tag: allmydata-tahoe-0.8.0~128 X-Git-Url: https://git.rkrishnan.org/pf/content/frontends/webapi.rst?a=commitdiff_plain;h=590b020a44edfaa81d6cd722508a7bb0e96b0efd;p=tahoe-lafs%2Ftahoe-lafs.git webish: more upload stats: total encode-and-push rate, already-in-grid existence check time --- diff --git a/src/allmydata/web/unlinked-upload.xhtml b/src/allmydata/web/unlinked-upload.xhtml index 6265af65..8c6000f1 100644 --- a/src/allmydata/web/unlinked-upload.xhtml +++ b/src/allmydata/web/unlinked-upload.xhtml @@ -25,12 +25,15 @@
  • Storage Index: ()
  • [Contacting Helper]:
  • +
  • [Upload Ciphertext To Helper]: ()
  • -
  • [Helper Total]:
  • Peer Selection:
  • -
  • Encode And Push:
  • +
  • Encode And Push: + ()
  • +
  • [Helper Total]:
  • diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 8704f6dd..b03a511b 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -1357,6 +1357,9 @@ class UnlinkedPOSTCHKUploader(rend.Page): def data_time_contacting_helper(self, ctx, data): return self._get_time("contacting_helper") + def data_time_existence_check(self, ctx, data): + return self._get_time("existence_check") + def data_time_cumulative_fetch(self, ctx, data): return self._get_time("cumulative_fetch") @@ -1404,6 +1407,25 @@ class UnlinkedPOSTCHKUploader(rend.Page): def data_rate_push(self, ctx, data): return self._get_rate("cumulative_sending") + def data_rate_encode_and_push(self, ctx, data): + d = self.upload_results() + def _convert(r): + file_size = r.file_size + if file_size is None: + return None + time1 = r.timings.get("cumulative_encoding") + if time1 is None: + return None + time2 = r.timings.get("cumulative_sending") + if time2 is None: + return None + try: + return 1.0 * file_size / (time1+time2) + except ZeroDivisionError: + return None + d.addCallback(_convert) + return d + def data_rate_ciphertext_fetch(self, ctx, data): d = self.upload_results() def _convert(r):