def rates(self, **kwargs): ''' Statistics >> rates format: { "vips": [ { "vip": "192.168.200.200", "port": 443, "connections/sec": 0, "inbound_packets/sec": 0, "inbound_bytes/sec": 0, "outbound_packets/sec": 0, "outbound_bytes/sec": 0, "rips": [ { "rip": "192.168.200.200", "port": 443, "connections/sec": 0, "inbound_packets/sec": 0, "inbound_bytes/sec": 0, "outbound_packets/sec": 0, "outbound_bytes/sec": 0 }, ... ] }, ... ] } ''' import libs.login if False == libs.login.cklogin(): raise _.HTTPRedirect('/') import ml_w_rates as wrt import json import libs.tools if "rates" in kwargs: pass else: data = wrt.get() return json.dumps(data)
def test_rates_g01(self): """ rates_g01 """ e = ml_w_rates.get(None, threading.RLock()) self.assertTrue(e[0], e[1])