Package limn.scene

Class FrameMetrics.Metric

java.lang.Object
limn.scene.FrameMetrics.Metric
Enclosing class:
FrameMetrics

public static final class FrameMetrics.Metric extends Object
A fixed-capacity ring of recent samples (oldest evicted first) exposing the latest value, the windowed average/max, and a copy of the history for a sparkline.
  • Method Details

    • count

      public int count()
      Returns:
      how many samples are currently held (up to the capacity)
    • last

      public float last()
      Returns:
      the most recent sample, or 0 when empty
    • average

      public float average()
      Returns:
      the mean over the held samples, or 0 when empty
    • max

      public float max()
      Returns:
      the maximum held sample, or 0 when empty
    • copyInto

      public int copyInto(float[] dst)
      Copies the held history, oldest→newest, into dst (up to its length; the newest samples win if dst is shorter).
      Returns:
      the number of samples written