-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111: Add searching for XHProf local files
- Loading branch information
Showing
37 changed files
with
1,225 additions
and
89 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\FilesObserver\FrameConverter; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
abstract class ObserverConfig | ||
{ | ||
/** @var non-empty-string|null */ | ||
public ?string $path = null; | ||
|
||
/** @var class-string<FrameConverter>|null */ | ||
public ?string $converterClass = null; | ||
|
||
/** @var float Scan interval in seconds */ | ||
public float $scanInterval = 5.0; | ||
|
||
/** | ||
* @psalm-assert-if-true non-empty-string $this->path | ||
* @psalm-assert-if-true class-string<FrameConverter> $this->converterClass | ||
*/ | ||
public function isValid(): bool | ||
{ | ||
/** @psalm-suppress RedundantCondition */ | ||
return $this->path !== null && $this->converterClass !== null && $this->path !== '' | ||
&& \is_a($this->converterClass, FrameConverter::class, true) && $this->scanInterval > 0.0; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\Config\PhpIni; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class SPX extends ObserverConfig | ||
{ | ||
/** @var non-empty-string|null Path to SPX files */ | ||
#[PhpIni('spx.data_dir')] | ||
public ?string $path = null; | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\Config\PhpIni; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class XDebug extends ObserverConfig | ||
{ | ||
/** @var non-empty-string|null Path to XDebug files */ | ||
#[PhpIni('xdebug.output_dir')] | ||
public ?string $path = null; | ||
} |
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server\Files; | ||
|
||
use Buggregator\Trap\Service\Config\Env; | ||
use Buggregator\Trap\Service\Config\PhpIni; | ||
use Buggregator\Trap\Service\FilesObserver\Converter\XHProf as Converter; | ||
use Buggregator\Trap\Service\FilesObserver\FrameConverter; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class XHProf extends ObserverConfig | ||
{ | ||
/** | ||
* @var int<0, 3> Edges sorting algorithm | ||
* Where: | ||
* 0 - Deep-first | ||
* 1 - Deep-first with sorting by WT | ||
* 2 - Level-by-level | ||
* 3 - Level-by-level with sorting by WT | ||
*/ | ||
#[Env('TRAP_XHPROF_SORT')] | ||
public int $algorithm = 3; | ||
|
||
/** @var non-empty-string|null Path to XHProf files */ | ||
#[Env('TRAP_XHPROF_PATH')] | ||
#[PhpIni('xhprof.output_dir')] | ||
public ?string $path = null; | ||
|
||
/** @var class-string<FrameConverter>|null */ | ||
public ?string $converterClass = Converter::class; | ||
} |
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
Oops, something went wrong.