Permalink
Browse files

πŸš€ Enable Heroku Ruby Metrics

  • Loading branch information...
adamdawkins committed Feb 8, 2019
1 parent a19a2ba commit 79a87d4a89ab8be857f0a6881d920526d4f7fa1f
Showing with 18 additions and 26 deletions.
  1. +3 βˆ’0 Gemfile
  2. +5 βˆ’0 Gemfile.lock
  3. +10 βˆ’26 config/puma.rb
@@ -9,6 +9,9 @@ gem 'bootsnap', '>= 1.1.0', require: false
gem 'puma', '~> 3.11'
gem 'sidekiq'

# Metrics
gem 'barnes'

# Database
gem 'data_migrate'
gem 'pg', '>= 0.18', '< 2.0'
@@ -52,6 +52,9 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
arel (9.0.0)
ast (2.4.0)
barnes (0.0.7)
multi_json (~> 1)
statsd-ruby (~> 1.1)
bootsnap (1.3.2)
msgpack (~> 1.0)
buftok (0.2.0)
@@ -255,6 +258,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
statsd-ruby (1.4.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
@@ -292,6 +296,7 @@ PLATFORMS

DEPENDENCIES
andand!
barnes
bootsnap (>= 1.1.0)
commonmarker (~> 0.16)
data_migrate
@@ -1,34 +1,18 @@
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
require 'barnes'

before_fork do
# worker specific setup

Barnes.start
end

threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }

# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
# preload_app!

# Allow puma to be restarted by `rails restart` command.


plugin :tmp_restart

0 comments on commit 79a87d4

Please sign in to comment.