mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 21:17:54 +00:00
OpenMetrics endpoint
This commit is contained in:
parent
2dbb9434b0
commit
ca865e60db
@ -1565,12 +1565,13 @@ class Statistics(MultiFormatResource):
|
||||
name.replace(".", "_")
|
||||
)
|
||||
|
||||
def mangle_value(val):
|
||||
return str(val) if val is not None else "NaN"
|
||||
|
||||
for (k, v) in sorted(stats['counters'].items()):
|
||||
ret += u"tahoe_counters_%s %s\n" % (mangle_name(k), v)
|
||||
|
||||
ret += u"tahoe_counters_%s %s\n" % (mangle_name(k), mangle_value(v))
|
||||
for (k, v) in sorted(stats['stats'].items()):
|
||||
ret += u"tahoe_stats_%s %s\n" % (mangle_name(k), v)
|
||||
|
||||
ret += u"tahoe_stats_%s %s\n" % (mangle_name(k), mangle_value(v))
|
||||
return ret
|
||||
|
||||
class StatisticsElement(Element):
|
||||
|
Loading…
Reference in New Issue
Block a user