Class Measure
Enables measuring of performance metrics during a performance test.
Inherited Members
Namespace: Unity.PerformanceTesting
Syntax
public static class Measure
Methods
Custom(String, Double)
Saves provided value as a performance measurement.
Declaration
public static void Custom(string name, double value)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sample group to save the value to. |
Double | value | Value to be saved. |
Custom(SampleGroup, Double)
Saves provided value as a performance measurement.
Declaration
public static void Custom(SampleGroup sampleGroup, double value)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup | sampleGroup | The sample group to save the value to. |
Double | value | Value to be saved. |
Frames()
Measures frame times with given parameters.
Declaration
public static FramesMeasurement Frames()
Returns
Type | Description |
---|---|
FramesMeasurement | FramesMeasurement using a builder pattern to provide parameters. Call Run() method to start measurement. |
Method(Action)
Measures execution time for a method with given parameters.
Declaration
public static MethodMeasurement Method(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action |
Returns
Type | Description |
---|---|
MethodMeasurement | MethodMeasurementusing a builder pattern to provide parameters. Call |
ProfilerMarkers(String[])
Measures profiler markers for the given scope.
Declaration
public static ProfilerMeasurement ProfilerMarkers(params string[] profilerMarkerLabels)
Parameters
Type | Name | Description |
---|---|---|
String[] | profilerMarkerLabels | List of profiler marker names. |
Returns
Type | Description |
---|---|
ProfilerMeasurement |
ProfilerMarkers(SampleGroup[])
Measures profiler markers for the given scope.
Declaration
public static ProfilerMeasurement ProfilerMarkers(params SampleGroup[] sampleGroups)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup[] | sampleGroups | List of SampleGroups where the name matches the profiler marker to measure. |
Returns
Type | Description |
---|---|
ProfilerMeasurement |
Scope(String)
Measures execution time for the given scope as a single time.
Declaration
public static ScopeMeasurement Scope(string name = "Time")
Parameters
Type | Name | Description |
---|---|---|
String | name | Name to use for the sample group. |
Returns
Type | Description |
---|---|
ScopeMeasurement | IDisposable ScopeMeasurement on which you should call the Dispose() method to stop measurement. |
Scope(SampleGroup)
Measures execution time for the given scope as a single time.
Declaration
public static ScopeMeasurement Scope(SampleGroup sampleGroup)
Parameters
Type | Name | Description |
---|---|---|
SampleGroup | sampleGroup | Sample group to use to save samples to. |
Returns
Type | Description |
---|---|
ScopeMeasurement | IDisposable ScopeMeasurement on which you should call the Dispose() method to stop measurement. |