-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)FeatureStopwatch
Description
Description
I'm playing with the Stopwatch component and I used something like this:
$this->stopwatch->start('export-data', 'export');
In the profiler I can see this ... but the export
custom category is not assigned a color, so it looks like a bug and it complicates understanding the different events:
Proposed solution
Let's assign a different color for each custom category.
In practice:
- We select 5 to 10 beautiful colors which are not already associated with Symfony things (the event's blue, the doctrine's orange, the twig's green, etc.)
- We assign a color randomly to each custom category.
Instead of pure randomness, we could apply the same strategy of the Asset component, which uses this code to always assign the same base URL for each path. This way we'd always select the same "random" color for the same category name:
protected function chooseBaseUrl($path)
{
return (int) fmod(hexdec(substr(hash('sha256', $path), 0, 10)), \count($this->baseUrls));
}
noniagriconomie, jvasseur and yceruto
Metadata
Metadata
Assignees
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)FeatureStopwatch