poc4 wit rust
This commit is contained in:
@@ -20,6 +20,9 @@ class RuntimeStats:
|
||||
"tzsp_unsupported": 0,
|
||||
"frames_injected": 0,
|
||||
"inject_errors": 0,
|
||||
"tzsp_kernel_udp_drops": 0,
|
||||
"tzsp_queue_drops": 0,
|
||||
"tzsp_truncated_datagrams": 0,
|
||||
"eve_events": 0,
|
||||
"eve_alerts": 0,
|
||||
"eve_parse_errors": 0,
|
||||
@@ -44,6 +47,17 @@ class RuntimeStats:
|
||||
with self._lock:
|
||||
self._data[key] = datetime.now(timezone.utc).isoformat()
|
||||
|
||||
def update_tzsp_receiver(self, values: dict[str, Any]) -> None:
|
||||
"""Replace Rust receiver counters from its compact telemetry sample."""
|
||||
with self._lock:
|
||||
for key, value in values.items():
|
||||
if key == "last_packet_at":
|
||||
if value:
|
||||
self._data[key] = value
|
||||
continue
|
||||
if isinstance(value, (int, float)) and not isinstance(value, bool):
|
||||
self._data[key] = value
|
||||
|
||||
def update_suricata(self, stats: dict[str, Any], timestamp: str | None = None) -> None:
|
||||
flattened: dict[str, int | float] = {}
|
||||
_flatten_numeric("", stats, flattened, 240)
|
||||
|
||||
Reference in New Issue
Block a user