bigpresh / bigpresh/Dancer-Plugin-NYTProf
Does not place nice with '/' (root) endpoint
- Dominant language
- Perl
- Stars
- 7
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
Hey there, thanks for your great work on this plugin :).
Some weird stuff happens when I try to profile the `/` endpoint of my app (which happens to be the main endpoint, so I basically can't use the plugin lol). Check it out:

```html
- (PID 24,Fri May 27 19:24:01 2022,0.2409 secs)
- checkstatus (PID 25,Fri May 27 19:20:41 2022,0.0092 secs)
- swag (PID 28,Fri May 27 19:20:36 2022,0.0004 secs)
```
I believe that can be attributed to [this line](https://github.com/bigpresh/Dancer-Plugin-NYTProf/blob/master/lib/Dancer/Plugin/NYTProf.pm#L156): `$path =~ s{^/}{};`.
Now that I'm looking at the HTML there seem to be some other issues too. E.g. ``, not sure what's going on there...
I don't know what the best way to fix this would be, maybe replacing a path consisting only of a `/` with `root`? Seems hacky, I don't know if there's any sentinel value we can use that wouldn't conflict with possible endpoint names.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read lib/Dancer/Plugin/NYTProf.pm at the linked line where the leading slash is removed, then reproduce profiling the app's `/` endpoint. Inspect the generated HTML shown in the issue, including the empty profile path and malformed link attributes. Done means the root endpoint produces a usable profile link and the generated listing remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100