mirror of
https://github.com/codex-storage/bittorrent-benchmarks.git
synced 2025-02-20 23:08:06 +00:00
fix: iterated experiment logging
This commit is contained in:
parent
ba1b93d77c
commit
ae678bc586
@ -203,14 +203,17 @@ type NodeId = str
|
|||||||
|
|
||||||
|
|
||||||
class Event(LogEntry):
|
class Event(LogEntry):
|
||||||
node: NodeId
|
|
||||||
name: str # XXX this ends up being redundant for custom event schemas... need to think of a better solution.
|
name: str # XXX this ends up being redundant for custom event schemas... need to think of a better solution.
|
||||||
timestamp: datetime.datetime = Field(
|
timestamp: datetime.datetime = Field(
|
||||||
default_factory=lambda: datetime.datetime.now(datetime.UTC)
|
default_factory=lambda: datetime.datetime.now(datetime.UTC)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class Metric(Event):
|
class NodeEvent(Event):
|
||||||
|
node: NodeId
|
||||||
|
|
||||||
|
|
||||||
|
class Metric(NodeEvent):
|
||||||
value: int | float
|
value: int | float
|
||||||
|
|
||||||
|
|
||||||
@ -219,14 +222,13 @@ class RequestEventType(Enum):
|
|||||||
end = "end"
|
end = "end"
|
||||||
|
|
||||||
|
|
||||||
class RequestEvent(Event):
|
class RequestEvent(NodeEvent):
|
||||||
destination: NodeId
|
destination: NodeId
|
||||||
request_id: str
|
request_id: str
|
||||||
type: RequestEventType
|
type: RequestEventType
|
||||||
|
|
||||||
|
|
||||||
class ExperimentStatus(Event):
|
class ExperimentStatus(Event):
|
||||||
name: str
|
|
||||||
repetition: int
|
repetition: int
|
||||||
duration: float
|
duration: float
|
||||||
error: Optional[str] = None
|
error: Optional[str] = None
|
||||||
@ -236,6 +238,7 @@ def basic_log_parser() -> LogParser:
|
|||||||
"""Constructs a basic log parser which can understand some common log entry types."""
|
"""Constructs a basic log parser which can understand some common log entry types."""
|
||||||
parser = LogParser()
|
parser = LogParser()
|
||||||
parser.register(Event)
|
parser.register(Event)
|
||||||
|
parser.register(NodeEvent)
|
||||||
parser.register(Metric)
|
parser.register(Metric)
|
||||||
parser.register(RequestEvent)
|
parser.register(RequestEvent)
|
||||||
parser.register(ExperimentStatus)
|
parser.register(ExperimentStatus)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user