Skip to content

Commit 92d9f0c

Browse files
committed
cleaning up
1 parent ec9f4c6 commit 92d9f0c

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

lib/actor_simulation.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ defmodule ActorSimulation do
121121
def add_actor(simulation, name, opts \\ []) do
122122
actor_def = Definition.new(name, opts)
123123

124-
# Inject trace collector if tracing is enabled
124+
# Inject trace collector if tracing is enabled and stats tracking
125125
actor_opts =
126126
if simulation.trace_enabled do
127-
[trace_collector: self()]
127+
[trace_collector: self(), stats_enabled: true]
128128
else
129-
[]
129+
[stats_enabled: true]
130130
end
131131

132132
{:ok, pid} = Actor.start_link(actor_def, simulation.clock, actor_opts)

lib/actor_simulation/actor.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ defmodule ActorSimulation.Actor do
2424

2525
def start_link(definition, clock, opts \\ []) do
2626
# Use test-local virtual clock injection instead of global
27-
# Also support trace collector injection
27+
# Also support trace collector injection and stats tracking
2828
trace_collector = Keyword.get(opts, :trace_collector)
29+
stats_enabled = Keyword.get(opts, :stats_enabled, false)
2930

3031
VirtualTimeGenServer.start_link(__MODULE__, {definition, trace_collector},
31-
virtual_clock: clock
32+
virtual_clock: clock,
33+
stats_enabled: stats_enabled
3234
)
3335
end
3436

0 commit comments

Comments
 (0)