-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathLaravelBench.php
69 lines (60 loc) · 1.55 KB
/
LaravelBench.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
declare(strict_types=1);
namespace Benchmarks\Integrations;
use DDTrace\Tests\Common\WebFrameworkTestCase;
use DDTrace\Tests\Frameworks\Util\Request\GetSpec;
class LaravelBench extends WebFrameworkTestCase
{
/**
* @BeforeMethods("disableLaravelTracing")
* @AfterMethods("afterMethod")
* @Revs(10)
* @Iterations(10)
* @OutputTimeUnit("microseconds")
* @RetryThreshold(10.0)
* @Warmup(1)
*/
public function benchLaravelBaseline()
{
$this->call(GetSpec::create(
'A simple GET request with a view',
'/simple_view?key=value&pwd=should_redact'
));
}
/**
* @BeforeMethods("enableLaravelTracing")
* @AfterMethods("afterMethod")
* @Revs(10)
* @Iterations(10)
* @OutputTimeUnit("microseconds")
* @RetryThreshold(10.0)
* @Warmup(1)
*/
public function benchLaravelOverhead()
{
$this->call(GetSpec::create(
'A simple GET request with a view',
'/simple_view?key=value&pwd=should_redact'
));
}
public static function getAppIndexScript()
{
return __DIR__ . '/../../Frameworks/Laravel/Version_10_x/public/index.php';
}
public function disableLaravelTracing()
{
$this->setUpWebServer([
'DD_TRACE_ENABLED' => 0,
]);
}
public function afterMethod()
{
$this->TearDownAfterClass();
}
public function enableLaravelTracing()
{
$this->setUpWebServer([
'DD_TRACE_ENABLED' => 1,
]);
}
}