Next commit is monitor.py that reads analyst.py also! This version to safety.
This commit is contained in:
@@ -81,7 +81,7 @@ def get_onramp_panel():
|
|||||||
data = query_onramp("status")
|
data = query_onramp("status")
|
||||||
if not data:
|
if not data:
|
||||||
LAG_HISTORY.clear() # Clear history if service goes down
|
LAG_HISTORY.clear() # Clear history if service goes down
|
||||||
return Panel(Text("OFFLINE", style="bold red"), title="[2] Onramp Service (Python)", border_style="red")
|
return Panel(Text("OFFLINE", style="bold red"), title="[2] Onramp Service (Go)", border_style="red")
|
||||||
|
|
||||||
# 1. Calculate Instant Lag
|
# 1. Calculate Instant Lag
|
||||||
last_ts = data.get('last_ts', 0) / 1000
|
last_ts = data.get('last_ts', 0) / 1000
|
||||||
@@ -108,7 +108,7 @@ def get_onramp_panel():
|
|||||||
content.append(f", {avg_1m:.2f}s/1m", style="dim" if avg_1m < 2 else "yellow")
|
content.append(f", {avg_1m:.2f}s/1m", style="dim" if avg_1m < 2 else "yellow")
|
||||||
content.append(f", {avg_5m:.2f}s/5m", style="dim" if avg_5m < 2 else "yellow")
|
content.append(f", {avg_5m:.2f}s/5m", style="dim" if avg_5m < 2 else "yellow")
|
||||||
|
|
||||||
return Panel(content, title="[2] Onramp Service (Python)", border_style="blue")
|
return Panel(content, title="[2] Onramp Service (Go)", border_style="blue")
|
||||||
|
|
||||||
def get_market_table():
|
def get_market_table():
|
||||||
res = query_onramp("live")
|
res = query_onramp("live")
|
||||||
@@ -148,7 +148,7 @@ def main():
|
|||||||
layout = make_layout()
|
layout = make_layout()
|
||||||
with Live(layout, refresh_per_second=2, screen=True):
|
with Live(layout, refresh_per_second=2, screen=True):
|
||||||
while True:
|
while True:
|
||||||
layout["header"].update(Panel(Text(f"BYBIT BTC UNIFIED MONITOR | {datetime.now().strftime('%H:%M:%S')}", justify="center", style="bold white on blue")))
|
layout["header"].update(Panel(Text(f"BYBIT BTCUSDT UNIFIED MONITOR | {datetime.now().strftime('%H:%M:%S')}", justify="center", style="bold white on blue")))
|
||||||
layout["input_svc"].update(get_input_panel())
|
layout["input_svc"].update(get_input_panel())
|
||||||
layout["onramp_svc"].update(get_onramp_panel())
|
layout["onramp_svc"].update(get_onramp_panel())
|
||||||
layout["market"].update(get_market_table())
|
layout["market"].update(get_market_table())
|
||||||
|
|||||||
Reference in New Issue
Block a user