Update mix python script for new log format
This commit is contained in:
parent
424585dd2a
commit
5a860b7b54
|
@ -6,10 +6,6 @@ from typing import Dict, Optional
|
||||||
import statistics
|
import statistics
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from json_stream.base import TransientStreamingJSONObject
|
|
||||||
|
|
||||||
JsonStream = Iterable[TransientStreamingJSONObject]
|
|
||||||
|
|
||||||
|
|
||||||
class Message:
|
class Message:
|
||||||
def __init__(self, message_id: str, step_a: Optional[int]):
|
def __init__(self, message_id: str, step_a: Optional[int]):
|
||||||
|
@ -71,8 +67,13 @@ def parse_record_stream(record_stream: Iterable[str]) -> MessageStorage:
|
||||||
storage: MessageStorage = {}
|
storage: MessageStorage = {}
|
||||||
|
|
||||||
for record in record_stream:
|
for record in record_stream:
|
||||||
json_record = json.loads(record)
|
try:
|
||||||
payload_id = json_record["payload_id"]
|
json_record = json.loads(record)
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if (payload_id := json_record.get("payload_id")) is None:
|
||||||
|
continue
|
||||||
step_id = json_record["step_id"]
|
step_id = json_record["step_id"]
|
||||||
|
|
||||||
if (stored_message := storage.get(payload_id)) is None:
|
if (stored_message := storage.get(payload_id)) is None:
|
||||||
|
|
Loading…
Reference in New Issue