Skip to content

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

Description

@imjching-shopify

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions