Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC] Automatic Stopwatch profiling via an attribute #47184

Copy link
Copy link
Closed
@94noni

Description

@94noni
Issue body actions

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

No one assigned

    Labels

    RFCRFC = 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)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.