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

Function TestSystem_Stats

pkg/actor/actor_test.go:269–282  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

267}
268
269func TestSystem_Stats(t *testing.T) {
270 system := NewSystem("test")
271 defer system.Shutdown()
272
273 // 创建多个 Actor
274 system.Spawn(&EchoActor{}, "echo1")
275 system.Spawn(&EchoActor{}, "echo2")
276 system.Spawn(&CounterActor{}, "counter")
277
278 time.Sleep(50 * time.Millisecond)
279
280 stats := system.Stats()
281 assert.Equal(t, int64(3), stats.TotalActors)
282}
283
284func TestSystem_ListActors(t *testing.T) {
285 system := NewSystem("test")

Callers

nothing calls this directly

Calls 4

ShutdownMethod · 0.95
SpawnMethod · 0.95
StatsMethod · 0.95
NewSystemFunction · 0.85

Tested by

no test coverage detected