Record Class DrawStats
java.lang.Object
java.lang.Record
com.botwithus.bot.api.draw.DrawStats
- Record Components:
count- retained commands, all connectionscapacity-DrawLimits.MAX_COMMANDStextSlotsUsed- retained text commandstextSlotCapacity-DrawLimits.MAX_TEXT_COMMANDSpolySlotsUsed- retained polyline commandspolySlotCapacity-DrawLimits.MAX_POLY_COMMANDSliveTargets- component highlights awaiting per-tick resolutiondropped- commands refused for want of a slot, all connections, since the producer started. A malformed command, an over-long key and an out-of-range coordinate are rejected before the store is touched and do not land here — this counter is not a way to detect them. Not to be confused withDrawBatchResult.dropped(), which is per-call and does count those: same name, different scope, and different membership.resolveFailures- component rects the game thread could not resolveresolveOverflow- ticks on which more thanDrawLimits.RESOLVED_COMPONENTS_PER_TICKhighlights were live. Non-zero means some highlight geometry is lagging the game by a tick or more; collection rotates, so nothing is starved permanently.isEnabled- drawing is switched onhasPresented- the renderer has delivered at least one framepresentFailures- failed uploadsisResolverLive- the per-tick component resolve has run at least oncebackendPresents- uploads that reached the screen, cumulative. Useful as a progress counter — a value higher than one sampled earlier means a frame was delivered in between. Do not compare it against the producer's frame counter: a frame whose dirty region is empty is processed without uploading anything, so they differ in normal operation and neither "equal" nor "unequal" means healthy.backend- which renderer is live, as the producer names itsurfaceWidth- overlay surface width in pixelssurfaceHeight- overlay surface height in pixels
public record DrawStats(int count, int capacity, int textSlotsUsed, int textSlotCapacity, int polySlotsUsed, int polySlotCapacity, int liveTargets, long dropped, long resolveFailures, long resolveOverflow, boolean isEnabled, boolean hasPresented, long presentFailures, boolean isResolverLive, long backendPresents, String backend, int surfaceWidth, int surfaceHeight)
extends Record
The producer's own account of its overlay: how full the store is, what it has
refused, and whether the renderer is alive.
The failure this exists to catch is an overlay that has silently died while looking perfectly healthy. Three fields are the ones worth asserting on:
presentFailures()— uploads that failed. The real health check, and falsifiable: break the present and it climbs.hasPresented()— the renderer has drawn at least one frame. False means a dead overlay, which otherwise looks exactly like an idle one.isResolverLive()— the game thread has returned resolved geometry at least once. "Rect unresolved" is also the initial state, so asserting only that would pass just as happily with the per-tick refresh never having run.
Do not build a check on frames matching presents. They answer different questions and differ in normal operation; the producer reports their difference as a diagnostic rather than a verdict, and this record deliberately does not carry either counter.
-
Constructor Summary
ConstructorsConstructorDescriptionDrawStats(int count, int capacity, int textSlotsUsed, int textSlotCapacity, int polySlotsUsed, int polySlotCapacity, int liveTargets, long dropped, long resolveFailures, long resolveOverflow, boolean isEnabled, boolean hasPresented, long presentFailures, boolean isResolverLive, long backendPresents, String backend, int surfaceWidth, int surfaceHeight) Creates an instance of aDrawStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbackend()Returns the value of thebackendrecord component.longReturns the value of thebackendPresentsrecord component.intcapacity()Returns the value of thecapacityrecord component.intcount()Returns the value of thecountrecord component.longdropped()Returns the value of thedroppedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasPresentedrecord component.booleanReturns the value of theisEnabledrecord component.booleanisFull()True when the store has no room for another command.booleanTrue when more component highlights are live than the producer resolves per tick, so some of their geometry is a tick or more behind the game.booleanReturns the value of theisResolverLiverecord component.intReturns the value of theliveTargetsrecord component.intReturns the value of thepolySlotCapacityrecord component.intReturns the value of thepolySlotsUsedrecord component.longReturns the value of thepresentFailuresrecord component.longReturns the value of theresolveFailuresrecord component.longReturns the value of theresolveOverflowrecord component.intReturns the value of thesurfaceHeightrecord component.intReturns the value of thesurfaceWidthrecord component.intReturns the value of thetextSlotCapacityrecord component.intReturns the value of thetextSlotsUsedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DrawStats
public DrawStats(int count, int capacity, int textSlotsUsed, int textSlotCapacity, int polySlotsUsed, int polySlotCapacity, int liveTargets, long dropped, long resolveFailures, long resolveOverflow, boolean isEnabled, boolean hasPresented, long presentFailures, boolean isResolverLive, long backendPresents, String backend, int surfaceWidth, int surfaceHeight) Creates an instance of aDrawStatsrecord class.- Parameters:
count- the value for thecountrecord componentcapacity- the value for thecapacityrecord componenttextSlotsUsed- the value for thetextSlotsUsedrecord componenttextSlotCapacity- the value for thetextSlotCapacityrecord componentpolySlotsUsed- the value for thepolySlotsUsedrecord componentpolySlotCapacity- the value for thepolySlotCapacityrecord componentliveTargets- the value for theliveTargetsrecord componentdropped- the value for thedroppedrecord componentresolveFailures- the value for theresolveFailuresrecord componentresolveOverflow- the value for theresolveOverflowrecord componentisEnabled- the value for theisEnabledrecord componenthasPresented- the value for thehasPresentedrecord componentpresentFailures- the value for thepresentFailuresrecord componentisResolverLive- the value for theisResolverLiverecord componentbackendPresents- the value for thebackendPresentsrecord componentbackend- the value for thebackendrecord componentsurfaceWidth- the value for thesurfaceWidthrecord componentsurfaceHeight- the value for thesurfaceHeightrecord component
-
-
Method Details
-
isFull
public boolean isFull()True when the store has no room for another command. -
isResolveLagging
public boolean isResolveLagging()True when more component highlights are live than the producer resolves per tick, so some of their geometry is a tick or more behind the game. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
count
-
capacity
-
textSlotsUsed
public int textSlotsUsed()Returns the value of thetextSlotsUsedrecord component.- Returns:
- the value of the
textSlotsUsedrecord component
-
textSlotCapacity
public int textSlotCapacity()Returns the value of thetextSlotCapacityrecord component.- Returns:
- the value of the
textSlotCapacityrecord component
-
polySlotsUsed
public int polySlotsUsed()Returns the value of thepolySlotsUsedrecord component.- Returns:
- the value of the
polySlotsUsedrecord component
-
polySlotCapacity
public int polySlotCapacity()Returns the value of thepolySlotCapacityrecord component.- Returns:
- the value of the
polySlotCapacityrecord component
-
liveTargets
public int liveTargets()Returns the value of theliveTargetsrecord component.- Returns:
- the value of the
liveTargetsrecord component
-
dropped
-
resolveFailures
public long resolveFailures()Returns the value of theresolveFailuresrecord component.- Returns:
- the value of the
resolveFailuresrecord component
-
resolveOverflow
public long resolveOverflow()Returns the value of theresolveOverflowrecord component.- Returns:
- the value of the
resolveOverflowrecord component
-
isEnabled
-
hasPresented
public boolean hasPresented()Returns the value of thehasPresentedrecord component.- Returns:
- the value of the
hasPresentedrecord component
-
presentFailures
public long presentFailures()Returns the value of thepresentFailuresrecord component.- Returns:
- the value of the
presentFailuresrecord component
-
isResolverLive
public boolean isResolverLive()Returns the value of theisResolverLiverecord component.- Returns:
- the value of the
isResolverLiverecord component
-
backendPresents
public long backendPresents()Returns the value of thebackendPresentsrecord component.- Returns:
- the value of the
backendPresentsrecord component
-
backend
-
surfaceWidth
public int surfaceWidth()Returns the value of thesurfaceWidthrecord component.- Returns:
- the value of the
surfaceWidthrecord component
-
surfaceHeight
public int surfaceHeight()Returns the value of thesurfaceHeightrecord component.- Returns:
- the value of the
surfaceHeightrecord component
-