Skip to content

Commit

Permalink
Merge pull request #122 from MITLibraries/tco-78-runtime-metrics
Browse files Browse the repository at this point in the history
Adds barnes gem to collect Ruby Language Metrics
  • Loading branch information
JPrevost authored Oct 17, 2024
2 parents 78dd771 + ae19c67 commit 817191e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end

# GC Statsd Reporter [https://github.com/heroku/barnes]
gem 'barnes'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false

Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ GEM
rake (>= 10.4, < 14.0)
ast (2.4.2)
attr_required (1.0.2)
barnes (0.0.9)
multi_json (~> 1)
statsd-ruby (~> 1.1)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.8)
Expand Down Expand Up @@ -230,6 +233,7 @@ GEM
mini_mime (1.1.5)
minitest (5.25.1)
msgpack (1.7.2)
multi_json (1.15.0)
mutex_m (0.2.0)
net-http (0.4.1)
uri
Expand Down Expand Up @@ -409,6 +413,7 @@ GEM
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-darwin)
sqlite3 (1.7.3-x86_64-linux)
statsd-ruby (1.5.0)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringex (2.8.6)
Expand Down Expand Up @@ -469,6 +474,7 @@ PLATFORMS
DEPENDENCIES
administrate (~> 0.20.1)
annotate
barnes
bootsnap
cancancan
capybara
Expand Down
3 changes: 3 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"buildpacks": [
{
"url": "heroku/ruby"
},
{
"url": "heroku/metrics"
}
]
}
8 changes: 8 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@

# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart

require 'barnes'

before_fork do
# worker specific setup

Barnes.start # Must have enabled worker mode for this to block to be called
end

0 comments on commit 817191e

Please sign in to comment.