]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: more upload stats: total encode-and-push rate, already-in-grid existence...
authorBrian Warner <warner@allmydata.com>
Wed, 6 Feb 2008 09:39:01 +0000 (02:39 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 6 Feb 2008 09:39:01 +0000 (02:39 -0700)
src/allmydata/web/unlinked-upload.xhtml
src/allmydata/webish.py

index 6265af65128cda41f668611ffb003504f56af95f..8c6000f1c3b3318e93bddbf0e0765349bb5aae33 100644 (file)
       <li>Storage Index: <span n:render="time" n:data="time_storage_index" />
      (<span n:render="rate" n:data="rate_storage_index" />)</li>
       <li>[Contacting Helper]: <span n:render="time" n:data="time_contacting_helper" /></li>
+      <ul>
+        <li>[Helper Already-In-Grid Check]: <span n:render="time" n:data="time_existence_check" /></li>
+      </ul>
       <li>[Upload Ciphertext To Helper]: <span n:render="time" n:data="time_cumulative_fetch" />
      (<span n:render="rate" n:data="rate_ciphertext_fetch" />)</li>
-      <li>[Helper Total]: <span n:render="time" n:data="time_helper_total" /></li>
 
       <li>Peer Selection: <span n:render="time" n:data="time_peer_selection" /></li>
-      <li>Encode And Push: <span n:render="time" n:data="time_total_encode_and_push" /></li>
+      <li>Encode And Push: <span n:render="time" n:data="time_total_encode_and_push" />
+        (<span n:render="rate" n:data="rate_encode_and_push" />)</li>
       <ul>
         <li>Cumulative Encoding: <span n:render="time" n:data="time_cumulative_encoding" />
         (<span n:render="rate" n:data="rate_encode" />)</li>
@@ -38,6 +41,7 @@
         (<span n:render="rate" n:data="rate_push" />)</li>
         <li>Send Hashes And Close: <span n:render="time" n:data="time_hashes_and_close" /></li>
       </ul>
+      <li>[Helper Total]: <span n:render="time" n:data="time_helper_total" /></li>
     </ul>
   </ul>
 </ul>
index 8704f6dde9f4c531441f6102b67ff11135b6e908..b03a511b9c20321f2a949f11b4848e503424895e 100644 (file)
@@ -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):