self._results.timings["cumulative_fetch"] = 0.0
self._results.timings["cumulative_decode"] = 0.0
self._results.timings["cumulative_decrypt"] = 0.0
+ self._results.timings["paused"] = 0.0
if IConsumer.providedBy(downloadable):
downloadable.registerProducer(self, True)
if self._paused:
return
self._paused = defer.Deferred()
+ self._paused_at = time.time()
if self._status:
self._status.set_paused(True)
def stopProducing(self):
self.log("Download.stopProducing")
self._stopped = True
+ paused_for = time.time() - self._paused_at
+ self._results.timings['paused'] += paused_for
if self._status:
self._status.set_stopped(True)
self._status.set_active(False)
<li>Cumulative Decrypting: <span n:render="time" n:data="time_cumulative_decrypt" />
(<span n:render="rate" n:data="rate_decrypt" />)</li>
</ul>
+ <li>Paused by client: <span n:render="time" n:data="time_paused" /></li>
</ul>
<li n:render="server_timings" />
</ul>
def data_time_cumulative_decrypt(self, ctx, data):
return self._get_time("cumulative_decrypt")
+ def data_time_paused(self, ctx, data):
+ return self._get_time("paused")
+
def _get_rate(self, name):
d = self.download_results()
def _convert(r):