← Về thư mục
skills/simpy/scripts/resource_monitor.py
- ResourceSample · class · L28-L35 — class ResourceSample
- ResourceMonitor · class · L38-L241 — class ResourceMonitor
- init · method · L41-L69 — def init( self, env: simpy.Environment, resource: simpy.Resource, name: str = "resource", )
- _record · method · L71-L81 — def _record(self, event: str, *, at: float | None = None) -> None
- _patch · method · L83-L124 — def _patch(self) -> None
- monitored_request · function · L85-L115 — def monitored_request(args: Any, *kwargs: Any) -> Any
- granted · function · L91-L95 — def granted(_: Any) -> None
- monitored_cancel · function · L103-L106 — def monitored_cancel() -> None
- monitored_release · function · L118-L121 — def monitored_release(args: Any, *kwargs: Any) -> Any
- detach · method · L126-L131 — def detach(self) -> None
- finalize · method · L133-L139 — def finalize(self, *, at: float | None = None) -> None
- _time_weighted · method · L141-L172 — def _time_weighted( self, attribute: str, *, start: float, end: float, ) -> float
- average_queue_length · method · L174-L182 — def average_queue_length( self, *, start: float = 0.0, end: float | None = None ) -> float
- average_utilization · method · L184-L190 — def average_utilization( self, *, start: float = 0.0, end: float | None = None ) -> float
- summary · method · L192-L222 — def summary( self, *, start: float = 0.0, end: float | None = None ) -> dict[str, Any]
- export_csv · method · L224-L241 — def export_csv(self, output: str, *, force: bool = False) -> None
- MultiResourceMonitor · class · L244-L271 — class MultiResourceMonitor
- init · method · L247-L250 — def init(self, env: simpy.Environment)
- add_resource · method · L252-L259 — def add_resource( self, resource: simpy.Resource, name: str ) -> ResourceMonitor
- finalize · method · L261-L263 — def finalize(self, *, at: float | None = None) -> None
- summaries · method · L265-L271 — def summaries( self, *, start: float = 0.0, end: float | None = None ) -> dict[str, dict[str, Any]]
- ContainerMonitor · class · L274-L353 — class ContainerMonitor
- init · method · L277-L295 — def init( self, env: simpy.Environment, container: simpy.Container, name: str = "container", )
- _record · method · L297-L304 — def _record(self, event: str, *, at: float | None = None) -> None
- _patch_operation · method · L306-L316 — def _patch_operation( self, operation: Callable[..., Any], event_name: str ) -> Callable[..., Any]
- wrapper · function · L310-L314 — def wrapper(args: Any, *kwargs: Any) -> Any
- _patch · method · L318-L320 — def _patch(self) -> None
- finalize · method · L322-L326 — def finalize(self, *, at: float | None = None) -> None
- average_level · method · L328-L353 — def average_level( self, *, start: float = 0.0, end: float | None = None ) -> float
- EventTraceRecorder · class · L356-L417 — class EventTraceRecorder
- init · method · L359-L376 — def init( self, env: simpy.Environment, *, max_records: int = 100_000, )
- _patch · method · L378-L398 — def _patch(self) -> None
- tracing_step · function · L380-L396 — def tracing_step() -> None
- detach · method · L400-L401 — def detach(self) -> None
- export_jsonl · method · L403-L417 — def export_jsonl(self, output: str, *, force: bool = False) -> None
- _demo · function · L420-L436 — def _demo() -> tuple[dict[str, Any], ResourceMonitor]
- user · function · L426-L430 — def user(identifier: int) -> Any
- build_parser · function · L439-L449 — def build_parser() -> argparse.ArgumentParser
- main · function · L452-L470 — def main(argv: list[str] | None = None) -> int