Class RealtimeStatistics
java.lang.Object
com.codename1.realtime.RealtimeStatistics
A snapshot of how a RealtimeThread's periods went: how late each release woke the
thread (latency), how long its cycles ran, and how many releases it missed.
Latency is the number to watch. Its maximum is the loop's real worst case on this
device, under whatever load ran beside it; getLatencyHistogram() shows how the
rest are spread. Taken with RealtimeThread.getStatistics().
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe number of buckets ingetLatencyHistogram(). -
Method Summary
Modifier and TypeMethodDescriptionlongThe number of allocations that ended a steady state on this thread.longThe number of cycles run.long[]Wake-up latencies counted by powers of two of a microsecond: index 0 is under one microsecond, index 1 under two, indexiunder2^imicroseconds, and the last bucket everything from about 16 milliseconds up.longgetLatencyPercentileNanos(double fraction) The latency, in nanoseconds, under which at leastfractionof the wake-ups fell, read from the histogram -- so it is the upper edge of a power-of-two bucket, an over-estimate by at most a factor of two.longThe longest a cycle ran, in nanoseconds: from its wake-up to its next wait.longThe latest any release woke the thread, in nanoseconds.longThe mean time a cycle ran, in nanoseconds.longThe mean wake-up latency, in nanoseconds.longThe number of releases skipped because a cycle ran past them.toString()One line, for a log.
-
Field Details
-
HISTOGRAM_BUCKETS
-
-
Method Details
-
getCycles
public long getCycles()The number of cycles run. -
getMissedPeriods
public long getMissedPeriods()The number of releases skipped because a cycle ran past them. -
getMaxLatencyNanos
public long getMaxLatencyNanos()The latest any release woke the thread, in nanoseconds. -
getMeanLatencyNanos
public long getMeanLatencyNanos()The mean wake-up latency, in nanoseconds. -
getMaxExecutionNanos
public long getMaxExecutionNanos()The longest a cycle ran, in nanoseconds: from its wake-up to its next wait. -
getMeanExecutionNanos
public long getMeanExecutionNanos()The mean time a cycle ran, in nanoseconds. -
getAllocationViolations
public long getAllocationViolations()The number of allocations that ended a steady state on this thread. -
getLatencyHistogram
public long[] getLatencyHistogram()Wake-up latencies counted by powers of two of a microsecond: index 0 is under one microsecond, index 1 under two, indexiunder2^imicroseconds, and the last bucket everything from about 16 milliseconds up. -
getLatencyPercentileNanos
public long getLatencyPercentileNanos(double fraction) The latency, in nanoseconds, under which at least
fractionof the wake-ups fell, read from the histogram -- so it is the upper edge of a power-of-two bucket, an over-estimate by at most a factor of two.Parameters
fraction: between 0 and 1, for example 0.9999
-
toString
-