public class MultiLevelProfiler extends Object
Graph2DRenderer
through sets of testing settings.
Has a ProfileGraph2D
with the type of the
Graph2DRenderer
being profiled.
Enables the profile object to be profile at various image resolutions and dataset sizes. These statistics may then be graphed or saved.
Constructor and Description |
---|
MultiLevelProfiler(ProfileGraph2D profiler)
Creates a object to profile a
Graph2DRenderer
using a ProfileGraph2D and analyzing performance
through various sets of renderings at specified intervals
of data sizes and image resolution sizes. |
Modifier and Type | Method and Description |
---|---|
static void |
defaultProfile(ProfileGraph2D profiler)
Sample multi-level profiling for a given renderer.
|
Map<Resolution,Map<Integer,Statistics>> |
getResults()
A mapping that gets the results of profiler that
maps a statistics result to every dataset size that is
mapped to every resolution.
|
SaveSettings |
getSaveSettings()
Gets the settings to be saved to the output file
for a profile.
|
List<Point2DDataset> |
getStatisticLineData()
Forms a set of point 2D data for each resolution profiled
where the point is composed of the number of data points profiled
and the average profile time.
|
void |
graphStatistics()
Displays a separate
frame for every profile operation
performed. |
void |
processPreResult(Resolution resolution,
int datasetSize)
Performed every iteration of profiling and is the action undertaken
before knowing the statistics about the profile.
|
void |
processResult(Resolution resolution,
int datasetSize,
Statistics stats)
Performed every iteration of profiling and is the action undertaken
after knowing the statistics about the profile.
|
void |
processTimeWarning(int estimatedTime)
Performed after the call to
profile but prior to actual
image rendering. |
void |
profile()
Runs through the list of dataset sizes paired with every element
from the list of image resolutions to profile a
ProfileGraph2D to analyze the performance of the graph
renderer and how the performance is effected by data size and
image size. |
void |
saveImages()
Saves the images generated by the profiling.
|
void |
saveStatistics()
Creates a table (.CSV format) to display the results,
with the dataset sizes as the row heading and the
resolution as the column heading.
|
void |
setDatasetSizes(List<Integer> nPoints)
Sets the dataset sizes to be profiled.
|
void |
setImageSizes(List<Resolution> resolutions)
Sets the resolution sizes to be profiled.
|
public MultiLevelProfiler(ProfileGraph2D profiler)
Graph2DRenderer
using a ProfileGraph2D
and analyzing performance
through various sets of renderings at specified intervals
of data sizes and image resolution sizes.profiler
- graph renderer with given profile settings to
do extensive testing onpublic void profile()
ProfileGraph2D
to analyze the performance of the graph
renderer and how the performance is effected by data size and
image size.
getResults()
public Map<Resolution,Map<Integer,Statistics>> getResults()
The keys to the outer map are the set of resolutions.
The keys to the inner map are the set of dataset sizes.
The value of the outer map is the inner map.
The value of the inner map is the statistics of the profiling.
Precondition: #profile()
has been called.
public List<Point2DDataset> getStatisticLineData()
public void graphStatistics()
frame
for every profile operation
performed.
Plots the sizes on the x-axis and the times on the y-axis.
Precondition: #profile()
has been called.public void saveStatistics()
Saves the CSV file to the same directory as general profile results, with the specific profile graph type as well as the date. Precondition: results is non-null and not empty, meaning profiling has been completed.
public void saveImages()
public void processTimeWarning(int estimatedTime)
profile
but prior to actual
image rendering.
Default behavior will display the estimated time based on the number of resolutions, number of dataset sizes, and the test time.
estimatedTime
- estimated time to profileprofile()
public void processPreResult(Resolution resolution, int datasetSize)
Default behavior is to print the resolution and dataset size to the console.
Override this to provide custom behaviors.
resolution
- resolution about to be profiled (image width, height)datasetSize
- size of data about to be profiledpublic void processResult(Resolution resolution, int datasetSize, Statistics stats)
Default behavior is to print the average time to the console.
Override this to provide custom behaviors.
resolution
- resolution just profiled (image width, height)datasetSize
- size of data just profiledstats
- results of the profilingpublic void setImageSizes(List<Resolution> resolutions)
resolutions
- set of resolutions to profilepublic void setDatasetSizes(List<Integer> nPoints)
ProfileGraph2D
field of this object will profile
repeatedly updating the number of data points in rendering.nPoints
- public SaveSettings getSaveSettings()
public static void defaultProfile(ProfileGraph2D profiler)
Graphs and saves the data.
profiler
- renderer to profile at multiple levelsCopyright © 2015. All rights reserved.