COB summary working

This commit is contained in:
Dobromir Popov
2025-06-30 02:20:36 +03:00
parent fab25ffe6f
commit 4c53871014
3 changed files with 467 additions and 855 deletions

View File

@ -1,69 +0,0 @@
#!/usr/bin/env python3
"""
Test COB Data Format - Check what data is actually available
"""
import time
import asyncio
from core.multi_exchange_cob_provider import MultiExchangeCOBProvider
async def test_cob_data_format():
"""Test what COB data format is actually available"""
print("=== COB DATA FORMAT TEST ===")
# Create COB provider directly (same as dashboard)
cob_provider = MultiExchangeCOBProvider(
symbols=['ETH/USDT', 'BTC/USDT'],
bucket_size_bps=1.0
)
# Add callback to capture data
captured_data = {}
def capture_callback(symbol: str, cob_snapshot):
captured_data[symbol] = cob_snapshot
print(f"Captured COB data for {symbol}:")
print(f" Type: {type(cob_snapshot)}")
print(f" Attributes: {dir(cob_snapshot)}")
# Check key attributes
if hasattr(cob_snapshot, 'consolidated_bids'):
print(f" Bids count: {len(cob_snapshot.consolidated_bids)}")
if hasattr(cob_snapshot, 'consolidated_asks'):
print(f" Asks count: {len(cob_snapshot.consolidated_asks)}")
if hasattr(cob_snapshot, 'spread_bps'):
print(f" Spread: {cob_snapshot.spread_bps}")
if hasattr(cob_snapshot, 'exchanges_active'):
print(f" Active exchanges: {len(cob_snapshot.exchanges_active)}")
print()
cob_provider.subscribe_to_cob_updates(capture_callback)
# Start COB provider
print("Starting COB provider...")
await cob_provider.start_streaming()
# Wait for data
print("Waiting for COB data...")
for i in range(30):
await asyncio.sleep(1)
if captured_data:
break
if i % 5 == 0:
print(f" Waiting... {i}s")
if captured_data:
print("SUCCESS: COB data captured!")
for symbol, cob_snapshot in captured_data.items():
print(f"\n{symbol} COB snapshot:")
print(f" Type: {type(cob_snapshot)}")
print(f" Has consolidated_bids: {hasattr(cob_snapshot, 'consolidated_bids')}")
print(f" Has consolidated_asks: {hasattr(cob_snapshot, 'consolidated_asks')}")
else:
print("No COB data captured")
# Stop COB provider
await cob_provider.stop_streaming()
if __name__ == "__main__":
asyncio.run(test_cob_data_format())

File diff suppressed because it is too large Load Diff

View File

@ -607,6 +607,18 @@ class DashboardComponentManager:
html.Span(f" @ {pred_time}", className="text-muted small")
], className="mb-1"),
# Timing information (NEW)
html.Div([
html.Span("Timing: ", className="text-muted small"),
html.Span(f"Inf: {model_info.get('timing', {}).get('last_inference', 'None')}", className="text-info small"),
html.Span(" | ", className="text-muted small"),
html.Span(f"Train: {model_info.get('timing', {}).get('last_training', 'None')}", className="text-warning small"),
html.Br(),
html.Span(f"Rate: {model_info.get('timing', {}).get('inferences_per_second', '0.00')}/s", className="text-success small"),
html.Span(" | ", className="text-muted small"),
html.Span(f"24h: {model_info.get('timing', {}).get('predictions_24h', 0)}", className="text-primary small")
], className="mb-1"),
# Loss metrics with improvement tracking
html.Div([
html.Span("Current Loss: ", className="text-muted small"),