Quick hack to add ActiveSupport Instrumentations to a class.
Add this line to your application's Gemfile:
gem 'instrumenter'And then execute:
$ bundle
Or install it yourself as:
$ gem install instrumenter
module Awesome
module Client
Instrumenter.instrument self, :awesome
def send_request
instrument 'request', method: 'something', url: 'something else', params: {foo: :bar} do
# Actual HTTP Request send
end
end
end
endYou'll get messages with timings in your log file, and aggregate timings at the bottom of log stanzas generated by controller actions.
Gem dependency versions are managed by Appraisal.
After any change to Appraisals, regenerate the appraisal gemfiles by running:
bundle exec appraisal generateTo install dependencies for all appraisal gemfiles, run:
bundle exec appraisal installTo run specs against a specific Rails version, run:
bundle exec appraisal rails-7.2 rspecGitHub Actions runs the Appraisal matrix declared in .github/workflows/ruby.yml, and RuboCop runs in .github/workflows/rubocop.yml.
- Fork it ( https://github.com/ifad/instrumenter/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request