forked from open-telemetry/opentelemetry-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize resource creation (open-telemetry#1210)
* reduce resource creation from sdk autoloader - instead of creating new resources from various factories, create them once from sdk autoloader and pass them to the factories (most of which already supported this). - check env before php.ini for config, since this is the more popular approach and saves some cycles - cache header from OtlpUtil, to save a couple of calls to Sdk detector * adding benchmark for resource creation
- Loading branch information
Showing
7 changed files
with
44 additions
and
13 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
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
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
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
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
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
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OpenTelemetry\Tests\Benchmark; | ||
|
||
use OpenTelemetry\SDK\Resource\ResourceInfoFactory; | ||
|
||
class ResourceCreationBench | ||
{ | ||
/** | ||
* @Revs({100, 1000}) | ||
* @Iterations(10) | ||
* @OutputTimeUnit("microseconds") | ||
*/ | ||
public function bench_create_default_resource(): void | ||
{ | ||
ResourceInfoFactory::defaultResource(); | ||
} | ||
} |