-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bench: Empty
index.php
web requests overhead
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?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) | ||
*/ | ||
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) | ||
*/ | ||
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, | ||
]); | ||
} | ||
} |