Skip to content

Use the format_response hook when recording performance bar metrics for API requests

Heinrich Lee Yu requested to merge move-grape-performance-bar-callback into master

What does this MR do?

With endpoint_run, we were missing some Redis / DB calls that are triggered during the serialization of data.

This happens very frequently because ActiveRecord relations are loaded lazily and these are most likely going to be triggered during serialization.

How to setup and validate locally (strongly suggested)

  1. Add localhost:3000/api/v4/projects to the performance bar
  2. Check api_json.log and compare the db_count and redis_calls to the numbers in the performance bar.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Heinrich Lee Yu

Merge request reports