Pub-Sub System

Generated by GenServerVirtualTime โ€ข Mermaid Flowchart

๐Ÿ“ˆ Simulation Summary

Virtual Time
1000ms
Real Time
10ms
Speedup
100.0x
Termination
โฑ Max Time

๐Ÿ“Š Actor Topology

flowchart TB publisher(["publisher
๐Ÿ“ค Sent: 30
๐Ÿ“ฅ Recv: 0"]) sub1["sub1
๐Ÿ“ค Sent: 0
๐Ÿ“ฅ Recv: 10"] sub2["sub2
๐Ÿ“ค Sent: 0
๐Ÿ“ฅ Recv: 10"] sub3["sub3
๐Ÿ“ค Sent: 0
๐Ÿ“ฅ Recv: 10"] publisher -->|:event
10/s| sub1 publisher -->|:event
10/s| sub2 publisher -->|:event
10/s| sub3 style publisher fill:#e8f5e9,stroke:#388e3c style sub1 fill:#e8f5e9,stroke:#388e3c style sub2 fill:#e8f5e9,stroke:#388e3c style sub3 fill:#e8f5e9,stroke:#388e3c

Node Shapes (Actor Type)

flowchart TD legend_source(["Source
(sends only)"]) legend_sink["Sink
(receives only)"] style legend_source fill:#ffffff,stroke:#666666,stroke-width:2px style legend_sink fill:#ffffff,stroke:#666666,stroke-width:2px

Node Colors (Activity Level)

flowchart LR activity_0["๐ŸŸข Medium Activity (10-50 msgs)"] style activity_0 fill:#e8f5e9,stroke:#388e3c

๐Ÿ“‰ Detailed Statistics

Actor Sent Received Send Rate Receive Rate Activity
publisher 30 0 30.0 msg/s 0.0 msg/s 30 total
sub1 0 10 0.0 msg/s 10.0 msg/s 10 total
sub2 0 10 0.0 msg/s 10.0 msg/s 10 total
sub3 0 10 0.0 msg/s 10.0 msg/s 10 total
Summary: Total messages: 60 โ€ข Duration: 1000ms โ€ข Actors: 4

๐Ÿ’ป Model Source Code

This is the Elixir code that defines the actor simulation model:

simulation =
ActorSimulation.new()
|> ActorSimulation.add_actor(:publisher,
  send_pattern: {:rate, 10, :event},
  targets: [:sub1, :sub2, :sub3]
)
|> ActorSimulation.add_actor(:sub1)
|> ActorSimulation.add_actor(:sub2)
|> ActorSimulation.add_actor(:sub3)
|> ActorSimulation.run(duration: 1000)