Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing a notice before the benchmark #1003

Open
tillkruss opened this issue Sep 23, 2022 · 8 comments
Open

Showing a notice before the benchmark #1003

tillkruss opened this issue Sep 23, 2022 · 8 comments

Comments

@tillkruss
Copy link
Contributor

Is there any mechanism to show a colonized notice/warning once before executing any test?

@dantleech
Copy link
Member

Not sure what you mean? What's the use case?

@tillkruss
Copy link
Contributor Author

For example our benchmarks are heavily skewed if New Relic is enabled. I was thinking of showing a warning.

@dantleech
Copy link
Member

Not really, you can add an "environment" sampler to add some env data which you could use in a Report:

https://github.com/phpbench/phpbench/blob/master/lib/Environment/Provider/Php.php

@dantleech
Copy link
Member

and you could add a custom progress logger that could show a warning, but maybe overkill (the env data is in $suite):

$this->output->writeln(sprintf(
'with PHP version %s, xdebug %s, opcache %s',
$summary->getPhpVersion() ?? '<unknown>',
$summary->getXdebugEnabled() ? '✔' : '❌',
$summary->getOpcacheEnabled() ? '✔' : '❌'
));

2 similar comments
@dantleech
Copy link
Member

and you could add a custom progress logger that could show a warning, but maybe overkill (the env data is in $suite):

$this->output->writeln(sprintf(
'with PHP version %s, xdebug %s, opcache %s',
$summary->getPhpVersion() ?? '<unknown>',
$summary->getXdebugEnabled() ? '✔' : '❌',
$summary->getOpcacheEnabled() ? '✔' : '❌'
));

@dantleech
Copy link
Member

and you could add a custom progress logger that could show a warning, but maybe overkill (the env data is in $suite):

$this->output->writeln(sprintf(
'with PHP version %s, xdebug %s, opcache %s',
$summary->getPhpVersion() ?? '<unknown>',
$summary->getXdebugEnabled() ? '✔' : '❌',
$summary->getOpcacheEnabled() ? '✔' : '❌'
));

@tillkruss
Copy link
Contributor Author

tillkruss commented Sep 23, 2022

That is a bit overkill.

Any chance you want to add New Relic to the Xdebug/Opcache list? It has a significant performant impact when running benchmarks.

@dantleech
Copy link
Member

Maybe , although needs more thought. What is there is a bit hacky, and wouldn't want to show "New Relic" on each run as we with XDebug/OPCache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants