public abstract class PerformanceTracker extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PerformanceTracker.SceneAccessor |
Constructor and Description |
---|
PerformanceTracker() |
Modifier and Type | Method and Description |
---|---|
abstract void |
doLogEvent(String s) |
abstract void |
doOutputLog() |
void |
frameRendered() |
float |
getAverageFPS()
Returns the average FPS in the time period since the least call
to
resetAverageFPS() . |
float |
getAveragePulses()
Returns the average pulses per second in the time period since the least call
to
resetAveragePulses() . |
float |
getInstantFPS()
Returns the number of frames rendered in the last second or so.
|
float |
getInstantPulses()
Returns the number of pulses received in the last second or so.
|
Runnable |
getOnFirstPulse() |
Runnable |
getOnPulse() |
Runnable |
getOnRenderedFrameTask() |
static PerformanceTracker |
getSceneTracker(Scene scene)
Creates a
PerformanceTracker for this scene. |
static boolean |
isLoggingEnabled()
Use method instead of def to avoid explicit initialization which could
be circular (this class may be referenced before the toolkit is initialized).
|
protected boolean |
isPerfLoggingEnabled() |
static void |
logEvent(String desc)
Log an event with given description.
|
protected abstract long |
nanoTime() |
static void |
outputLog()
Output full log of events so far.
|
void |
pulse() |
static void |
releaseSceneTracker(Scene scene)
Removes the tracker from the scene.
|
void |
resetAverageFPS() |
void |
resetAveragePulses() |
void |
setOnFirstPulse(Runnable value) |
void |
setOnPulse(Runnable value) |
void |
setOnRenderedFrameTask(Runnable value) |
protected void |
setPerfLoggingEnabled(boolean value) |
static void |
setSceneAccessor(PerformanceTracker.SceneAccessor accessor) |
public static boolean isLoggingEnabled()
public static PerformanceTracker getSceneTracker(Scene scene)
PerformanceTracker
for this scene. There could be only one
performance tracker per scene so once a tracker is created for a scene it
will be returned for each getSceneTracker
call until the tracker
is released with releaseSceneTracker(Scene)
. PerformanceTracker
associated with the scene
or null if the tracker couldn't be created.public static void releaseSceneTracker(Scene scene)
public static void setSceneAccessor(PerformanceTracker.SceneAccessor accessor)
public static void logEvent(String desc)
public static void outputLog()
protected boolean isPerfLoggingEnabled()
protected void setPerfLoggingEnabled(boolean value)
protected abstract long nanoTime()
public abstract void doOutputLog()
public abstract void doLogEvent(String s)
public float getInstantFPS()
public float getAverageFPS()
resetAverageFPS()
.public void resetAverageFPS()
public float getInstantPulses()
public float getAveragePulses()
resetAveragePulses()
.public void resetAveragePulses()
public void pulse()
public void frameRendered()
public void setOnPulse(Runnable value)
public Runnable getOnPulse()
public void setOnFirstPulse(Runnable value)
public Runnable getOnFirstPulse()
public void setOnRenderedFrameTask(Runnable value)
public Runnable getOnRenderedFrameTask()
Copyright © 2020. All rights reserved.