sentry icon indicating copy to clipboard operation
sentry copied to clipboard

fix(perf): Fetch widget overall numbers from API

Open gggritso opened this issue 3 years ago • 0 comments

Before: Screen Shot 2022-08-04 at 11 16 57 AM

After: Screen Shot 2022-08-04 at 11 17 05 AM

Closes PERF-1383. Instead of using JS to calculate the overall value, fetch those values from the API. Makes one batched AJAX call to /events/ to fetch the overall value for that time period for those fields. You can see that the values in the top right of the widgets are more accurate.

Changes

  • Fetch overall widget number from discover

    Remove unused JS-land mean. Add DiscoverQuery to fetch the data instead.

  • Make GenericQueryBatcher more generic

    Untie the response processing from the assumed data format. Not all batches responses can be unrolled using result[propertyName]! Sometimes the data is more deeply nested.

    Instead, ask for the transform prop, which will unroll (or not) the response as required.

  • Add batching support to GenericDiscoverQuery

    Allow passing in a query batcher, and respect it if it exists.

  • Add DiscoverQuery batching

    Pass batching information to DiscoverQuery in the widgets. Update specs, etc.

gggritso avatar Aug 04 '22 15:08 gggritso