Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware's action should not be called if there are no samples in the profile #2

Open
imjching-shopify opened this issue Mar 25, 2020 · 0 comments
Labels
good first issue Good for newcomers

Comments

@imjching-shopify
Copy link
Contributor

We should avoid calling the middleware's action (e.g. UploadAction) if there are no samples in the profile.

action.call(
profile,
response: response,
autoredirect: params.autoredirect,
)

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:

return unless stackprof_profile

@imjching-shopify imjching-shopify added the good first issue Good for newcomers label Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant