Shopify / Shopify/app_profiler
Middleware's action should not be called if there are no samples in the profile
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 268
- Forks
- 14
- Avg merge
- 1h 9m
- Merged PRs (30d)
- 1
Description
We should avoid calling the middleware's action (e.g. UploadAction) if there are no samples in the profile.
When a request returns quickly during a profiling session, there is a possibility in which the profiler could not sample anything in time. There won't be any samples for those profiles, and speedscope won't recognize them either. We should drop such profiles.
One way to do so would be to return nil if the value for samples is 0 whenever profiling results are retrieved:
https://github.com/Shopify/app_profiler/blob/80df44c69c8bd7dedb1c250c1ecec422ffa4f838/lib/app_profiler/profiler.rb#L30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/app_profiler/middleware.rb at the linked action call and lib/app_profiler/profiler.rb where profiling results are retrieved. Trace how the samples value reaches the middleware, then verify that profiles with zero samples produce no middleware action or upload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100