Vixen
02b45cc4
csharp
public sealed class RealmHeartbeat

The two-second sample, and the window it is computed over.

Read the guide page for this →

Remarks

p99 rather than a mean, because the mean is the number that flatters. A shard whose average tick is 4 ms and whose p99 is 40 ms is one where every player sees a hitch twice a second, and doc 27 § Health's whole point is that such a shard should stop being a placement candidate before it stops being playable. A mean never says so.

A fixed ring rather than a histogram: the window is a few hundred ticks, sorting it costs microseconds every two seconds, and an approximate quantile structure would be a second thing to be wrong about for a measurement that is already only advisory.

Fields and properties (4)

  • public static TimeSpan DefaultInterval

    What doc 27 § Health specifies, and what Lost counts.

  • public TimeSpan Interval

    How often a sample is due.

  • public int WindowSize

    How many ticks the window holds.

  • public long SampleCount

    How many samples have been taken.

Methods (5)

  • public RealmHeartbeat(TimeSpan? interval = null, int windowSize = 256)

    Stands a heartbeat up.

  • public void Observe(TimeSpan tick)

    Records how long a tick took.

  • public bool IsDue(TimeSpan elapsed)

    Advances the clock and says whether a sample is due.

  • public double TickP99()

    The tail of the window, in milliseconds.

  • public double TickMean()

    The middle of the window, in milliseconds.

Used by (3)

  • MapAndHeartbeatTestsVixen.Live.Realm.Tests
  • RealmHostVixen.Live.Realm
  • RealmHostOptionsVixen.Live.Realm