Add support for monitoring arbitrary blocks of code using performance monitoring
To be able to more accurately measure performance of blocks of code we'll need to have a way to monitor whatever happens in a Ruby block. For example:
Gitlab::Metrics.measure_block('the_name_of_the_series') do
...
end
One use case of this: being able to measure the amount of calls to the /allowed
API calls. Right now we can't do this as InfluxDB doesn't allow searching by unindexed values and Grape only provides URLs (not action names) which aren't indexed.
cc @pcarranza