added tor circuit stats to main page
This commit is contained in:
parent
57f233d856
commit
5c636246fb
9 changed files with 1066 additions and 9 deletions
|
@ -26,7 +26,7 @@ import unpaddedbase32
|
|||
from httpapi import apiutils
|
||||
import onionrcrypto, config
|
||||
from netcontroller import NetController
|
||||
from serializeddata import SerializedData
|
||||
from statistics.serializeddata import SerializedData
|
||||
from onionrutils import mnemonickeys
|
||||
from onionrutils import bytesconverter
|
||||
from etc import onionrvalues
|
||||
|
|
|
@ -4,6 +4,7 @@ SSE API for node client access
|
|||
"""
|
||||
from flask import g, Blueprint
|
||||
from gevent import sleep
|
||||
#from time import sleep
|
||||
|
||||
from statistics.transports.tor import TorStats
|
||||
from .. import wrapper
|
||||
|
@ -38,9 +39,8 @@ def stream_hello():
|
|||
@private_sse_blueprint.route('/torcircuits')
|
||||
def stream_tor_circuits():
|
||||
tor_stats = g.too_many.get(TorStats)
|
||||
def stream():
|
||||
def circuit_stat_stream():
|
||||
while True:
|
||||
yield tor_stats.get_json()
|
||||
|
||||
sleep(3)
|
||||
return SSEWrapper.handle_sse_request(stream)
|
||||
yield "data: " + tor_stats.get_json() + "\n\n"
|
||||
sleep(10)
|
||||
return SSEWrapper.handle_sse_request(circuit_stat_stream)
|
||||
|
|
|
@ -25,7 +25,7 @@ from etc import onionrvalues, cleanup
|
|||
from onionrcrypto import getourkeypair
|
||||
from utils import hastor, logoheader
|
||||
from . import version
|
||||
import serializeddata
|
||||
from statistics import serializeddata
|
||||
import runtests
|
||||
from httpapi import daemoneventsapi
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue