-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathEmptyFileBench.php
69 lines (60 loc) · 1.49 KB
/
EmptyFileBench.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 EmptyFileBench extends WebFrameworkTestCase
{
/**
* @BeforeMethods("disabledTracing")
* @AfterMethods("afterMethod")
* @Revs(10)
* @Iterations(10)
* @OutputTimeUnit("microseconds")
* @RetryThreshold(10.0)
* @Warmup(1)
*/
public function benchEmptyFileBaseline()
{
$this->call(GetSpec::create(
'A web request to a framework not using auto loaders',
'/'
));
}
/**
* @BeforeMethods("enableTracing")
* @AfterMethods("afterMethod")
* @Revs(10)
* @Iterations(10)
* @OutputTimeUnit("microseconds")
* @RetryThreshold(10.0)
* @Warmup(1)
*/
public function benchEmptyFileOverhead()
{
$this->call(GetSpec::create(
'A web request to a framework not using auto loaders',
'/'
));
}
public static function getAppIndexScript()
{
return __DIR__ . '/../../Frameworks/Custom/Version_Not_Autoloaded/index.php';
}
public function disabledTracing()
{
$this->setUpWebServer([
'DD_TRACE_ENABLED' => 0,
]);
}
public function afterMethod()
{
$this->TearDownAfterClass();
}
public function enableTracing()
{
$this->setUpWebServer([
'DD_TRACE_ENABLED' => 1,
]);
}
}