Nebula
Control plane

ScopeRetireContext

What the retire policy is told about a scope.

generated from the sources
public struct ScopeRetireContext

What the retire policy is told about a scope. Everything here is derived from rows the whole mesh can see (the scope row, its lease rows, and the per-container occupancy the workers' telemetry reports), so the decision is reproducible on any orchestrator and a policy can be tested without a mesh.

Fields

Scope

public ScopeInfo Scope;

The row being judged. Never null when the policy is called.

IdleSeconds

public double IdleSeconds;

Seconds since anything last wanted any part of this scope: the smallest age over the lease rows of its live parts (ScopeLifecycle.CollectParts). One busy part keeps the whole scope hot, which is what "all parts retire together" requires.

Entities

public int Entities;

Authoritative entities the workers last reported inside the scope's live parts, summed, riders of vehicles in them included.

Players

public int Players;

Client-owned entities inside the scope's live parts (players and bots), summed, including those riding in vehicles.

RetireAfterSeconds

public float RetireAfterSeconds;

The configured idle threshold, in seconds (NebulaConfig.ScopeIdleRetireSeconds); 0 or less turns retiring off.

RetireWithEntities

public bool RetireWithEntities;

The configured NebulaConfig.ScopeRetireWithEntities: when true, entities nobody plays (Entities beyond Players) don't keep an idle scope. Persistent ones are checkpointed by the retire and come back with the scope; anything a retire would lose already keeps the scope's idle clock at zero on its worker, so the scope never reaches the threshold.

On this page