Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed Rails Example #61

Merged
merged 1 commit into from

2 participants

@jkamenik

I am using statsd hosted on an amazon instance. Everything worked when I copied your Rails example and tested locally, but it wouldn't work in the cloud.

Debugging showed me it was that the config was always blank and therefore defaulted to "localhost:8125". I have fixed it to properly load config in both the rails and normal case.

@kastner kastner merged commit 422b3f6 into etsy:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 16, 2012
  1. @jkamenik
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 3 deletions.
  1. +2 −3 examples/ruby_example2.rb
View
5 examples/ruby_example2.rb
@@ -74,11 +74,10 @@ def self.send(data, sample_rate=1)
end
end
- @@config = {}
def self.config
- return @@config if @@config
+ return @@config if self.class_variable_defined?(:@@config)
begin
- config_path = File.join(File.dir(__FILE__), "statsd.yml")
+ config_path = File.join(File.dirname(__FILE__), "statsd.yml")
# for Rails environments, check Rails.root/config/statsd.yml
if defined? Rails
config_path = File.join(Rails.root, "config", "statsd.yml")
Something went wrong with that request. Please try again.