You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## [2.8.0] - 2021-03-16
Add overloads to measurements for overriding sample unit
Fix cases where cleanup throws an exception
## [2.7.0] - 2021-02-19
Reduce metadata overhead when running locally by caching dependencies
Remove the need for link.xml
Restructured documentation
Fixed method measurement IterationsPerMeasurement
***ProfilerMarkers(...)** - sample profile markers per frame. Does not work for deep profiling and `Profiler.BeginSample()`
8
8
***SampleGroup(string name)** - name of the measurement, defaults to "Time" if unspecified.
9
-
***Scope()** - measures frame times in a given coroutine scope.
9
+
***Scope()** - measures frame times in a given coroutine scope. By default it uses a SampleGroup named "Time" with Milliseconds as measurement unit. You can also create your own SampleGroup, specifying a custom name and the measurement unit you want your results in, see [example 5](#example-5-specify-custom-samplegroup-in-the-scope).
10
10
11
11
12
12
#### Example 1: Simple frame time measurement using default values of at least 7 frames and default WarmupCount (see description above).
@@ -67,3 +67,34 @@ public IEnumerator Test()
67
67
.Run();
68
68
}
69
69
```
70
+
#### Example 5: Specify Custom SampleGroup in the Scope
Copy file name to clipboardExpand all lines: Documentation~/measure-method.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ Executes the provided method, sampling performance using the following additiona
5
5
***MeasurementCount(int n)** - number of measurements to capture, defaults to 9 if not specified.
6
6
***IterationsPerMeasurement(int n)** - number of method executions per measurement to use. If this value is not specified, the method is executed as many times as possible until approximately 100 ms has elapsed.
7
7
***SampleGroup(string name)** - name of the measurement, defaults to "Time" if unspecified.
8
+
***SampleGroup(SampleGroup sampleGroup)** - a sample group with a custom name and measurement unit. This will override the otherwise default value of "Time".
8
9
***GC()** - if specified, measures the total number of Garbage Collection allocation calls.
9
10
***SetUp(Action action)** - is called every iteration before method execution. Setup time is not measured.
10
11
***CleanUp(Action action)** - is called every iteration after method execution. Cleanup time is not measured.
@@ -22,7 +23,7 @@ public void Test()
22
23
23
24
#### Example 2: Customize Measure.Method properties
24
25
25
-
```
26
+
```csharp
26
27
[Test, Performance]
27
28
publicvoidTest()
28
29
{
@@ -36,3 +37,15 @@ public void Test()
36
37
.Run();
37
38
}
38
39
```
40
+
41
+
#### Example 3: Measure.Method, SampleGroup and ProfilerMarkers
Copy file name to clipboardExpand all lines: Documentation~/measure-profile-markers.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Used to record profiler markers. Profiler marker timings are recorded automatically and sampled within the scope of the `using` statement. Names should match profiler marker labels. Profiler markers are sampled once per frame. Sampling the same profiler marker per frame will result in the sum of all invocations. Note that deep and editor profiling is not available. Profiler markers created using `Profiler.BeginSample()` are not supported, switch to `ProfilerMarker` if possible.
4
4
5
+
You can also create your own SampleGroups, specifying a custom name and the measurement units you want your results in, see [example 2](#example-2-measuring-profiler-markers-in-a-scope-with-custom-samplegroups).
6
+
5
7
#### Example: Measuring profiler markers in a scope
6
8
7
9
```csharp
@@ -22,3 +24,23 @@ public void Test()
22
24
}
23
25
}
24
26
```
27
+
28
+
#### Example 2: Measuring profiler markers in a scope with custom SampleGroups
Copy file name to clipboardExpand all lines: Documentation~/measure-scope.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
# Measure.Scope(string name = "Time")
2
2
3
3
Measures execution time for the scope as a single time, for both synchronous and coroutine methods. Passing the name argument overrides the name of the created SampleGroup.
4
+
The defualt SampleGroup is named "Time" and with Milliseconds as measurement unit. You can also create your own SampleGroup, specifying a custom name and the measurement unit you want your results in, see [example 2](#example-2-specify-custom-samplegroup).
4
5
5
-
#### Example: Measuring a scope; execution time is measured for everything in the using statement
6
+
#### Example 1: Measuring a scope; execution time is measured for everything in the using statement
0 commit comments