Closed
Description
Description
Hello,
I am thinking/asking if we can automatically profile (in dev
env) some code execution via an attribute?
Reference this documentation
The main idea is to not have to alter business code "just to profile"
Example
Given the code on documentation link, here could be a replacement:
use Symfony\Component\Stopwatch\Attribute\AsStopwatchProfile;
class DataExporter
{
#[AsStopwatchProfile]
public function export()
{
// ...do things to export data...
}
}
The export()
code execution would be automatically measured with stopwatch
and named for example DataExporter::export
and displayed in the profiler
Metadata
Metadata
Assignees
Labels
RFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)