MCPcopy Create free account
hub / github.com/astercloud/aster / TestActorStats

Method TestActorStats

examples/actor/actor_test.go:207–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205}
206
207func (s *ActorSuite) TestActorStats() {
208 // 创建多个 Actor
209 s.system.Spawn(&EchoActor{name: "echo1"}, "echo1")
210 s.system.Spawn(&EchoActor{name: "echo2"}, "echo2")
211 s.system.Spawn(&CounterActor{name: "counter"}, "counter")
212
213 time.Sleep(50 * time.Millisecond)
214
215 stats := s.system.Stats()
216 s.Equal(int64(3), stats.TotalActors, "应有 3 个 Actor")
217}
218
219func (s *ActorSuite) TestActorStop() {
220 echo := &EchoActor{name: "echo"}

Callers

nothing calls this directly

Calls 2

SpawnMethod · 0.45
StatsMethod · 0.45

Tested by

no test coverage detected