Git Product home page Git Product logo

barnes's Introduction

barnes's People

Contributors

apg avatar apghero avatar calavera avatar dhh avatar drusepth avatar edmorley avatar eileencodes avatar jeremy avatar jphenow avatar noahhl avatar olleolleolle avatar rwojnarowski avatar schneems avatar simonrussell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

barnes's Issues

Do rubygems release.

To take ruby metrics into private beta we should probably release this gem on rubygems.

WARNING Thread started in app boot with puma in cluster mode

Hi!

We're getting the following log output when switching to puma cluster mode about a barnes thread starting in app boot.

Do you know if this is something to worry about or something safe to ignore like it was discussed for the ActiveRecord one?

2020-11-02T16:47:56.793226+00:00 app[web.1]: [4] Puma starting in cluster mode...
2020-11-02T16:47:56.793334+00:00 app[web.1]: [4] * Version 5.0.2 (ruby 2.6.6-p146), codename: Spoony Bard
2020-11-02T16:47:56.793364+00:00 app[web.1]: [4] * Min threads: 5, max threads: 5
2020-11-02T16:47:56.793433+00:00 app[web.1]: [4] * Environment: staging
2020-11-02T16:47:56.793467+00:00 app[web.1]: [4] * Process workers: 2
2020-11-02T16:47:56.793499+00:00 app[web.1]: [4] * Preloading application
2020-11-02T16:48:05.004277+00:00 app[web.1]: ** [NewRelic] FATAL : Config file at /app/config/newrelic.yml doesn't include a 'staging' section!
2020-11-02T16:48:05.236417+00:00 app[web.1]: RAILS_ENV=staging environment is not defined in config/webpacker.yml, falling back to production environment
2020-11-02T16:48:09.238369+00:00 app[web.1]: [4] * Listening on http://0.0.0.0:27573
2020-11-02T16:48:09.238587+00:00 app[web.1]: [4] ! WARNING: Detected 2 Thread(s) started in app boot:
2020-11-02T16:48:09.238688+00:00 app[web.1]: [4] ! #<Thread:0x000055f6920dfb68@/app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:299 sleep> - /app/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:301:in `sleep'
2020-11-02T16:48:09.238801+00:00 app[web.1]: [4] ! #<Thread:0x000055f691e92248@/app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:39 sleep> - /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:48:in `sleep'

Thanks!

Rails 6 support

Is this gem supported in Rails 6? I'm starting the upgrade process for an app from 5.2 to 6.0 and don't see anything in the README about 6+, so I thought I'd ask before just removing the gem. Thanks!

Crashing

As reported by a beta user:

May 11 02:27:15 act-api app/web.1: #<Thread:0x0000000005317db0@/app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:39 run> terminated with exception (report_on_exception is true): 
May 11 02:27:15 act-api app/web.1: /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `+': nil can't be coerced into Integer (TypeError) 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `reduce' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `instrument!' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:46:in `block in instrument!' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `each' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `instrument!' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:58:in `block (3 levels) in initialize' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `each' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `block (2 levels) in initialize' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `loop' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `block in initialize' 
May 11 02:27:15 act-api app/web.1: [59] ! Detected parent died, dying 
May 11 02:27:15 act-api app/web.1: Exiting 
May 11 02:27:15 act-api app/web.1: /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `+': nil can't be coerced into Integer (TypeError) 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `reduce' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `instrument!' 
May 11 02:27:15 act-api app/web.1: [114] ! Detected parent died, dying 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:46:in `block in instrument!'
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `each' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `instrument!' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:58:in `block (3 levels) in initialize' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `each' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `block (2 levels) in initialize' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `loop' 
May 11 02:27:15 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `block in initialize'
May 11 02:27:37 act-api app/web.1: #<Thread:0x00000000042a11e8@/app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:39 run> terminated with exception (report_on_exception is true): 
May 11 02:27:37 act-api app/web.1: /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `+': nil can't be coerced into Integer (TypeError) 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `reduce' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `instrument!' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:46:in `block in instrument!' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `each' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `instrument!' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:58:in `block (3 levels) in initialize' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `each' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `block (2 levels) in initialize' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `loop' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `block in initialize' 
May 11 02:27:37 act-api app/web.1: #<Thread:0x0000000001c0eff8@/app/vendor/bundle/ruby/2.5.0/gems/puma-3.11.4/lib/puma/cluster.rb:276 run> terminated with exception (report_on_exception is true): 
May 11 02:27:37 act-api app/web.1: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.11.4/lib/puma/cluster.rb:285:in `write': Broken pipe (Errno::EPIPE) 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.11.4/lib/puma/cluster.rb:285:in `<<' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/puma-3.11.4/lib/puma/cluster.rb:285:in `block in worker' 
May 11 02:27:37 act-api app/web.1: [60] ! Detected parent died, dying 
May 11 02:27:37 act-api app/web.1: [55] ! Detected parent died, dying 
May 11 02:27:37 act-api app/web.1: Exiting 
May 11 02:27:37 act-api app/web.1: /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `+': nil can't be coerced into Integer (TypeError) 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `reduce' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/instruments/puma_backlog.rb:41:in `instrument!' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:46:in `block in instrument!' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `each' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/panel.rb:45:in `instrument!' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:58:in `block (3 levels) in initialize' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `each' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:57:in `block (2 levels) in initialize' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `loop' 
May 11 02:27:37 act-api app/web.1: 	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.4/lib/barnes/periodic.rb:46:in `block in initialize' 

Gem cannot be installed on machines other than Richard's laptop

This happens when we do a bundle install with the latest version of the gem.

Gem::Package::PathError: installing into parent path /Users/schneems/Documents/projects/barnes/init.rb of <REDACTED>/gems/barnes-0.0.2 is not
allowed
An error occurred while installing barnes (0.0.2), and Bundler cannot continue.
Make sure that `gem install barnes -v '0.0.2'` succeeds before bundling.

Incompatible with dogstatsd gem

I seem to be getting this error when running this gem alongside the dogstatsd one:

#<Thread:0x00007fb3dd809948@/app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/periodic.rb:39 run> terminated with exception (report_on_exception is true):

/app/vendor/bundle/ruby/2.5.0/gems/dogstatsd-ruby-1.6.0/lib/statsd.rb:339:in `send_stats': undefined method `[]' for 0.16666666666666666:Float (NoMethodError)

	from /app/vendor/bundle/ruby/2.5.0/gems/dogstatsd-ruby-1.6.0/lib/statsd.rb:137:in `count'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/reporter.rb:53:in `block (2 levels) in report_statsd'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/reporter.rb:52:in `each'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/reporter.rb:52:in `block in report_statsd'

	from /app/vendor/bundle/ruby/2.5.0/gems/dogstatsd-ruby-1.6.0/lib/statsd.rb:292:in `batch'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/reporter.rb:51:in `call'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/reporter.rb:51:in `report_statsd'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/reporter.rb:47:in `report'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/periodic.rb:62:in `block (2 levels) in initialize'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/periodic.rb:46:in `loop'

	from /app/vendor/bundle/ruby/2.5.0/gems/barnes-0.0.7/lib/barnes/periodic.rb:46:in `block in initialize'

rake aborted!

Unfortunately I don't have any time to investigate it myself right now, but as the Ruby metrics are in beta I figured you guys might want to know :)

Compatibility with Puma master branch

I just attempted to use Puma master, and requests were failing with the following:

/app/vendor/ruby-2.6.5/lib/ruby/2.6.0/json/common.rb:156:in `initialize': no implicit conversion of Hash into String (TypeError)
	from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/json/common.rb:156:in `new'
	from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/json/common.rb:156:in `parse'
	from /app/vendor/bundle/ruby/2.6.0/gems/multi_json-1.14.1/lib/multi_json/adapters/json_common.rb:14:in `load'
	from /app/vendor/bundle/ruby/2.6.0/gems/multi_json-1.14.1/lib/multi_json/adapter.rb:21:in `load'
	from /app/vendor/bundle/ruby/2.6.0/gems/multi_json-1.14.1/lib/multi_json.rb:122:in `load'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/instruments/puma_instrument.rb:24:in `json_stats'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/instruments/puma_instrument.rb:36:in `instrument!'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/panel.rb:46:in `block in instrument!'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/panel.rb:45:in `each'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/panel.rb:45:in `instrument!'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:58:in `block (3 levels) in initialize'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:57:in `each'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:57:in `block (2 levels) in initialize'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:46:in `loop'
	from /app/vendor/bundle/ruby/2.6.0/gems/barnes-0.0.8/lib/barnes/periodic.rb:46:in `block in initialize'Exception

In puma/puma#2086, Puma.stats was changed to return a Hash instead of a String. I'm assuming this line needs to be updated to support that.

MultiJson.load(::Puma.stats || "{}")

The non-rails method doesn't require necessary files

The require statements at the top of the railtie need to be moved to lib/barnes.rb so they are required even if you aren't using Rails. Otherwise folks using sinatra have to manually require all the files in the gem in their app's initializers.

Add some documentation for use.

This is not currently documented, and as a result it's not clear how to set this up in a ruby app.

For rails, I think it's a matter of using the Railtie. For any other ruby app, it's a bit different, which isn't documented.

Support loading on Windows, use CLOCK_REALTIME or CLOCK_MONOTONIC

Strangely, for the first time ever tonight, Rails failed to start on my windows dev machine because Barnes tries to use Process.clock_gettime with Process::CLOCK_PROCESS_CPUTIME_ID. Again, I have no clue why this is an issue all of a sudden. I haven't changed anything reasonably related since last successful start. Either way, Ruby on Windows only currently supports CLOCK_REALTIME and CLOCK_MONOTONIC.

It's easy for me to workaround, since I don't actually need barnes in development or test, so I just add it to the :production group in my gemfile. Perhaps someone should update the docs to say it should be added in production? Or otherwise nop out the code.

The stacktrace is:

C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/instruments/stopwatch.rb:77:in `clock_gettime': Invalid argument - clock_gettime (Errno::EINVAL)
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/instruments/stopwatch.rb:77:in `cpu'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/instruments/stopwatch.rb:64:in `current'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/instruments/stopwatch.rb:33:in `start!'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/panel.rb:38:in `block in start!'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/panel.rb:37:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/panel.rb:37:in `start!'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/periodic.rb:43:in `block (2 levels) in initialize'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/barnes-0.0.9/lib/barnes/periodic.rb:42:in `each'

endless stack trace on master

$ heroku logs --tail
...
2017-10-19T19:01:53.567717+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `loop'
2017-10-19T19:01:53.567717+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `block in initialize'
2017-10-19T19:01:53.568670+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `/'
2017-10-19T19:01:53.568671+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `block in instrument!'
2017-10-19T19:01:53.568672+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `each'
2017-10-19T19:01:53.568672+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `instrument!'
2017-10-19T19:01:53.568673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:23:in `block in instrument!'
2017-10-19T19:01:53.568673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `each'
2017-10-19T19:01:53.568674+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `instrument!'
2017-10-19T19:01:53.568674+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:32:in `block (3 levels) in initialize'
2017-10-19T19:01:53.568675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `each'
2017-10-19T19:01:53.568675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `block (2 levels) in initialize'
2017-10-19T19:01:53.568675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `loop'
2017-10-19T19:01:53.568676+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `block in initialize'
2017-10-19T19:01:53.569578+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `/'
2017-10-19T19:01:53.569579+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `block in instrument!'
2017-10-19T19:01:53.569580+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `each'
2017-10-19T19:01:53.569580+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `instrument!'
2017-10-19T19:01:53.569580+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:23:in `block in instrument!'
2017-10-19T19:01:53.569581+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `each'
2017-10-19T19:01:53.569581+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `instrument!'
2017-10-19T19:01:53.569581+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:32:in `block (3 levels) in initialize'
2017-10-19T19:01:53.569582+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `each'
2017-10-19T19:01:53.569583+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `block (2 levels) in initialize'
2017-10-19T19:01:53.569583+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `loop'
2017-10-19T19:01:53.569584+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `block in initialize'
2017-10-19T19:01:53.570490+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `/'
2017-10-19T19:01:53.570492+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `block in instrument!'
2017-10-19T19:01:53.570492+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `each'
2017-10-19T19:01:53.570493+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `instrument!'
2017-10-19T19:01:53.570493+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:23:in `block in instrument!'
2017-10-19T19:01:53.570494+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `each'
2017-10-19T19:01:53.570495+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `instrument!'
2017-10-19T19:01:53.570496+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:32:in `block (3 levels) in initialize'
2017-10-19T19:01:53.570496+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `each'
2017-10-19T19:01:53.570497+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `block (2 levels) in initialize'
2017-10-19T19:01:53.570497+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `loop'
2017-10-19T19:01:53.570497+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `block in initialize'
2017-10-19T19:01:53.571412+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `/'
2017-10-19T19:01:53.571413+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `block in instrument!'
2017-10-19T19:01:53.571414+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `each'
2017-10-19T19:01:53.571414+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `instrument!'
2017-10-19T19:01:53.571414+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:23:in `block in instrument!'
2017-10-19T19:01:53.571415+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `each'
2017-10-19T19:01:53.571415+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `instrument!'
2017-10-19T19:01:53.571416+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:32:in `block (3 levels) in initialize'
2017-10-19T19:01:53.571417+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `each'
2017-10-19T19:01:53.571417+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:31:in `block (2 levels) in initialize'
2017-10-19T19:01:53.571417+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `loop'
2017-10-19T19:01:53.571418+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/periodic.rb:20:in `block in initialize'
2017-10-19T19:01:53.572484+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `/'
2017-10-19T19:01:53.572487+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:74:in `block in instrument!'
2017-10-19T19:01:53.572487+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `each'
2017-10-19T19:01:53.572488+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/instruments/ruby_gc.rb:71:in `instrument!'
2017-10-19T19:01:53.572488+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:23:in `block in instrument!'
2017-10-19T19:01:53.572489+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bundler/gems/barnes-61644edb837c/lib/barnes/panel.rb:22:in `each'
...

Undefined method 'new' for Statsd:Module (NoMethodError) on Puma start

Hello,
I'm getting this error when I try to start my rails server:

/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/barnes-0.0.7/lib/barnes.rb:47:in `start': undefined method `new' for Statsd:Module (NoMethodError)
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/barnes-0.0.7/lib/barnes/railtie.rb:44:in `block in <class:Railtie>'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:347:in `each'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:347:in `call'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
/config/environment.rb:5:in `<top (required)>'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
/config.ru:3:in `block in <main>'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
/config.ru:in `new'
/config.ru:in `<main>'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/server.rb:59:in `app'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/server.rb:124:in `log_to_stdout'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/server.rb:77:in `start'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
/bin/rails:9:in `require'
/bin/rails:9:in `<top (required)>'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/bin/spring:49:in `<top (required)>'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'
/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/.rbenv/versions/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

Also, in IRB when I do:

require 'statsd'

Statsd.new(....)

it works without raising any errors.

Would appreciate any help in resolving this issue.
Thank you.

Ruby 2.7 warnings

The following warning gets printed when barnes gem is loaded:

.../barnes-0.0.7/lib/barnes/railtie.rb:44: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
.../barnes-0.0.7/lib/barnes.rb:40: warning: The called method `start' is defined here

Derive monotonically incrementing values.

We currently submit gauges to statsd for some monotonically increasing values, which leads to some interesting weirdness for display/interpretation purposes, since when aggregated, you end up with dips due to dyno restarts, or something else.

To combat this, we can derive monotonically increasing values such that we're submitted the change rate, probably just sampled based on the period.

Do not include gem in test environment

The Readme currently suggest to just include the gem in the Gemfile. However, it's a bad idea to include it in the test environment. When running on the Heroku CI it will start a thread that makes calls to Kernel.rand(). Those calls will mess up the test seed and test failures on the CI will not be reliably reproducible locally anymore. It took us a long time to debug this issue and it would be good if the Readme would state this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.