File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,25 +104,24 @@ Target: Foobar\Baz\MyEnum::test; Path: /path/to/profiling/code.php; Iterations:
104104A ** fluent, unit-aware PHPUnit helper** for asserting profiler metrics.
105105
106106``` php
107- use Bakame\Stackwatch\Test\MetricsAssertions ;
107+ use Bakame\Stackwatch\Test\PerformanceAssertions ;
108108use PHPUnit\Framework\Attributes\Test;
109109use PHPUnit\Framework\TestCase;
110110
111111final class ExampleTest extends TestCase
112112{
113- use MetricsAssertions ;
113+ use PerformanceAssertions ;
114114
115115 #[Test]
116116 public function it_can_test_callback_performance(): void
117117 {
118118 $performance = $this
119- ->iter (5)
119+ ->iterations (5)
120120 ->warmup(2)
121- ->aggMedian()
122- ->assertMetrics($service->calculateHeavyStuff(...));
123-
124- $performance->executionTime()->lessThan(200, 'milliseconds')
125- $performance->memoryUsage()->greaterThan(10, 'mb');
121+ ->assertPerformance($service->calculateHeavyStuff(...));
122+
123+ $performance->median()->executionTime()->lessThan(200, 'milliseconds')
124+ $performance->range()->memoryUsage()->greaterThan(10, 'mb');
126125 }
127126}
128127```
You can’t perform that action at this time.
0 commit comments