Package com.jme3.app
Class BasicProfiler
java.lang.Object
com.jme3.app.BasicProfiler
- All Implemented Interfaces:
AppProfiler
An AppProfiler implementation that collects two
per-frame application-wide timings for update versus
render and uses it to create a bar chart style Mesh.
The number of frames displayed and the update interval
can be specified. The chart Mesh is in 'milliseconds'
and can be scaled up or down as required.
Each column of the chart represents a single frames timing. Yellow represents the time it takes to perform all non-rendering activities (running enqueued tasks, stateManager.update, control.update(), etc) while the cyan portion represents the rendering time.
When the end of the chart is reached, the current frame cycles back around to the beginning.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called at the beginning of the specified AppStep.void
appSubStep
(String... additionalInfo) Called as a substep of the previous AppStepprotected final void
int
getMesh()
Returns the mesh that contains the bar chart of tracked frame timings.long
final void
setFrameCount
(int size) Sets the number of frames to display and track.void
setUpdateInterval
(long nanos) Sets the number of nanoseconds to wait before updating the mesh.void
Called at the beginning of the specified SpStep (SceneProcessor step).protected void
void
vpStep
(VpStep step, ViewPort vp, RenderQueue.Bucket bucket) Called at the beginning of the specified VpStep during the rendering of the specified ViewPort.
-
Constructor Details
-
BasicProfiler
public BasicProfiler() -
BasicProfiler
public BasicProfiler(int size)
-
-
Method Details
-
setFrameCount
public final void setFrameCount(int size) Sets the number of frames to display and track. By default, this is 1280.- Parameters:
size
- the desired number of frames (≥0, default=1280)
-
getFrameCount
public int getFrameCount() -
setUpdateInterval
public void setUpdateInterval(long nanos) Sets the number of nanoseconds to wait before updating the mesh. By default, this is once a millisecond, i.e. 1000000 nanoseconds.- Parameters:
nanos
- the desired update interval (in nanoseconds, default=1e6)
-
getUpdateInterval
public long getUpdateInterval() -
getMesh
Returns the mesh that contains the bar chart of tracked frame timings.- Returns:
- the pre-existing Mesh
-
createMesh
protected final void createMesh() -
updateMesh
protected void updateMesh() -
appStep
Description copied from interface:AppProfiler
Called at the beginning of the specified AppStep.- Specified by:
appStep
in interfaceAppProfiler
- Parameters:
step
- the application-level step that's about to begin
-
appSubStep
Description copied from interface:AppProfiler
Called as a substep of the previous AppStep- Specified by:
appSubStep
in interfaceAppProfiler
- Parameters:
additionalInfo
- information about the substep
-
vpStep
Description copied from interface:AppProfiler
Called at the beginning of the specified VpStep during the rendering of the specified ViewPort. For bucket-specific steps the Bucket parameter will be non-null.- Specified by:
vpStep
in interfaceAppProfiler
- Parameters:
step
- the ViewPort-level step that's about to beginvp
- which ViewPort is being processedbucket
- which Bucket is being processed
-
spStep
Description copied from interface:AppProfiler
Called at the beginning of the specified SpStep (SceneProcessor step). For more detailed steps it is possible to provide additional information as strings, like the name of the processor.- Specified by:
spStep
in interfaceAppProfiler
- Parameters:
step
- the SceneProcessor step that's about to beginadditionalInfo
- information about the SceneProcessor step
-