probe: Add probe-stats method to show some general statistics

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2019-08-22 23:20:30 +02:00
parent e4f8d2d0b8
commit 8b24e19bbb

View file

@ -121,6 +121,15 @@ def probe(request, plugin, node_id=None, **kwargs):
})
@plugin.method('probe-stats')
def stats(plugin):
return {
'pending_probes': len(plugin.pending_probes),
'exclusions': len(exclusions),
'temporary_exclusions': len(temporary_exclusions),
}
def complete_probe(plugin, request, probe_id, payment_hash):
s = plugin.Session()
p = s.query(Probe).get(probe_id)