mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-01 10:46:42 +00:00
Wrap renderer return values in tags
This commit is contained in:
parent
1e3ba25cc3
commit
a0eb00b2cc
@ -1224,39 +1224,39 @@ class StatisticsElement(Element):
|
|||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def load_average(self, req, tag):
|
def load_average(self, req, tag):
|
||||||
return str(self._stats["stats"].get("load_monitor.avg_load"))
|
return tag(str(self._stats["stats"].get("load_monitor.avg_load")))
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def peak_load(self, req, tag):
|
def peak_load(self, req, tag):
|
||||||
return str(self._stats["stats"].get("load_monitor.max_load"))
|
return tag(str(self._stats["stats"].get("load_monitor.max_load")))
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def uploads(self, req, tag):
|
def uploads(self, req, tag):
|
||||||
files = self._stats["counters"].get("uploader.files_uploaded", 0)
|
files = self._stats["counters"].get("uploader.files_uploaded", 0)
|
||||||
bytes = self._stats["counters"].get("uploader.bytes_uploaded", 0)
|
bytes = self._stats["counters"].get("uploader.bytes_uploaded", 0)
|
||||||
return ("%s files / %s bytes (%s)" %
|
return tag(("%s files / %s bytes (%s)" %
|
||||||
(files, bytes, abbreviate_size(bytes)))
|
(files, bytes, abbreviate_size(bytes))))
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def downloads(self, req, tag):
|
def downloads(self, req, tag):
|
||||||
files = self._stats["counters"].get("downloader.files_downloaded", 0)
|
files = self._stats["counters"].get("downloader.files_downloaded", 0)
|
||||||
bytes = self._stats["counters"].get("downloader.bytes_downloaded", 0)
|
bytes = self._stats["counters"].get("downloader.bytes_downloaded", 0)
|
||||||
return ("%s files / %s bytes (%s)" %
|
return tag("%s files / %s bytes (%s)" %
|
||||||
(files, bytes, abbreviate_size(bytes)))
|
(files, bytes, abbreviate_size(bytes)))
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def publishes(self, req, tag):
|
def publishes(self, req, tag):
|
||||||
files = self._stats["counters"].get("mutable.files_published", 0)
|
files = self._stats["counters"].get("mutable.files_published", 0)
|
||||||
bytes = self._stats["counters"].get("mutable.bytes_published", 0)
|
bytes = self._stats["counters"].get("mutable.bytes_published", 0)
|
||||||
return "%s files / %s bytes (%s)" % (files, bytes,
|
return tag("%s files / %s bytes (%s)" % (files, bytes,
|
||||||
abbreviate_size(bytes))
|
abbreviate_size(bytes)))
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def retrieves(self, req, tag):
|
def retrieves(self, req, tag):
|
||||||
files = self._stats["counters"].get("mutable.files_retrieved", 0)
|
files = self._stats["counters"].get("mutable.files_retrieved", 0)
|
||||||
bytes = self._stats["counters"].get("mutable.bytes_retrieved", 0)
|
bytes = self._stats["counters"].get("mutable.bytes_retrieved", 0)
|
||||||
return "%s files / %s bytes (%s)" % (files, bytes,
|
return tag("%s files / %s bytes (%s)" % (files, bytes,
|
||||||
abbreviate_size(bytes))
|
abbreviate_size(bytes)))
|
||||||
|
|
||||||
@renderer
|
@renderer
|
||||||
def raw(self, req, tag):
|
def raw(self, req, tag):
|
||||||
|
Loading…
Reference in New Issue
Block a user