web UI added and refactoring done

This commit is contained in:
Ayzen
2026-06-06 00:06:30 +03:00
parent 3c30a12d4a
commit af6005d68f
65 changed files with 3630 additions and 4720 deletions
+12 -8
View File
@@ -136,6 +136,7 @@ def main() -> int:
return 0 # asked to stop before a device became available
collection_id = 1
publish_failures = 0
while not stop_requested.is_set():
collection_start = time.monotonic()
capture_start_ns = time.monotonic_ns()
@@ -193,14 +194,17 @@ def main() -> int:
capture_end_ns=time.monotonic_ns(),
)
payload = serialize_trace_collection(collection, RAW_MAGIC)
if not raw_writer.push(payload):
raise RuntimeError(
f"Raw payload size {len(payload)} exceeds ring slot size {raw_writer.slot_size_bytes}"
)
if not raw_tap_writer.push(payload):
raise RuntimeError(
f"Raw tap payload size {len(payload)} exceeds ring slot size {raw_tap_writer.slot_size_bytes}"
)
if raw_writer.push(payload):
raw_tap_writer.push(payload) # best-effort GUI tap; never fatal
else:
# Oversized payload vs the ring slot is a persistent config error, not
# a device fault: log (throttled) and skip rather than killing the producer.
publish_failures += 1
if publish_failures == 1 or publish_failures % 100 == 0:
logger.error(
"Raw payload %d B exceeds ring slot %d B; dropping collection %d (drops=%d)",
len(payload), raw_writer.slot_size_bytes, collection_id, publish_failures,
)
if not config.runtime.continuous:
break