Class FramesMeasurement
Allows measuring of frame times.
Inherited Members
Namespace: Unity.PerformanceTesting.Measurements
Syntax
public class FramesMeasurement
Methods
DontRecordFrametime()
Specifies frame times should not be recorded.
Declaration
public FramesMeasurement DontRecordFrametime()
Returns
Type | Description |
---|---|
FramesMeasurement |
DynamicMeasurementCount(Double, ConfidenceLevel, OutlierMode)
Dynamically find a suitable measurement count based on the margin of error of the samples. The measurements will stop once a certain amount of samples (specified by a confidence interval) falls within an acceptable error range from the result (defined by a relative error of the mean).
Declaration
public FramesMeasurement DynamicMeasurementCount(double maxRelativeError, ConfidenceLevel confidenceLevel = ConfidenceLevel.L99, OutlierMode outlierMode = OutlierMode.Remove)
Parameters
Type | Name | Description |
---|---|---|
Double | maxRelativeError | The maximum relative error of the mean that the margin of error must fall into. |
ConfidenceLevel | confidenceLevel | The confidence interval which will be used to calculate the margin of error. |
OutlierMode | outlierMode | Outlier mode allows to include or exclude outliers when evaluating the stop criterion. |
Returns
Type | Description |
---|---|
FramesMeasurement |
DynamicMeasurementCount(OutlierMode)
Dynamically find a suitable measurement count based on the margin of error of the samples. The measurements will stop once a certain amount of samples (specified by a confidence interval) falls within an acceptable error range from the result (defined by a relative error of the mean). A default margin of error range of 2% and a default confidence interval of 99% will be used.
Declaration
public FramesMeasurement DynamicMeasurementCount(OutlierMode outlierMode = OutlierMode.Remove)
Parameters
Type | Name | Description |
---|---|---|
OutlierMode | outlierMode | Outlier mode allows to include or exclude outliers when evaluating the stop criterion. |
Returns
Type | Description |
---|---|
FramesMeasurement |
MeasurementCount(Int32)
Count of measurements to take.
Declaration
public FramesMeasurement MeasurementCount(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | Count of measurements. |
Returns
Type | Description |
---|---|
FramesMeasurement |
ProfilerMarkers(String[])
Records provided profiler markers once per frame.
Declaration
public FramesMeasurement ProfilerMarkers(params string[] profilerMarkerNames)
Parameters
Type | Name | Description |
---|---|---|
String[] | profilerMarkerNames | Profiler marker names as in profiler window. |
Returns
Type | Description |
---|---|
FramesMeasurement |
ProfilerMarkers(SampleGroup[])
Records provided profiler markers once per frame.
Declaration
public FramesMeasurement ProfilerMarkers(params SampleGroup[] sampleGroups)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup[] | sampleGroups | List of SampleGroups where a name matches the profiler marker and desired SampleUnit |
Returns
Type | Description |
---|---|
FramesMeasurement |
Run()
Executes the frame time measurement with given parameters. When MeasurementCount is not provided, a probing method will run to determine desired measurement counts.
Declaration
public IEnumerator Run()
Returns
Type | Description |
---|---|
IEnumerator | IEnumerator to yield until finish. |
SampleGroup(String)
Overrides the name of default sample group "Time".
Declaration
public FramesMeasurement SampleGroup(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the sample group. |
Returns
Type | Description |
---|---|
FramesMeasurement |
SampleGroup(SampleGroup)
Overrides the default sample group "Time"
Declaration
public FramesMeasurement SampleGroup(SampleGroup sampleGroup)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup | sampleGroup | Sample group to use. |
Returns
Type | Description |
---|---|
FramesMeasurement |
Scope(String)
Switches frame time measurement to asynchronous scope measurement.
Declaration
public FramesMeasurement.ScopedFrameTimeMeasurement Scope(string name = "Time")
Parameters
Type | Name | Description |
---|---|---|
String | name | Sample group name. |
Returns
Type | Description |
---|---|
FramesMeasurement.ScopedFrameTimeMeasurement |
Scope(SampleGroup)
Switches frame time measurement to asynchronous scope measurement.
Declaration
public FramesMeasurement.ScopedFrameTimeMeasurement Scope(SampleGroup sampleGroup)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup | sampleGroup | Sample group to save measurements. |
Returns
Type | Description |
---|---|
FramesMeasurement.ScopedFrameTimeMeasurement |
WarmupCount(Int32)
Count of warmup executions.
Declaration
public FramesMeasurement WarmupCount(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | Count of warmup executions. |
Returns
Type | Description |
---|---|
FramesMeasurement |