Permalink
Browse files

Small cleanup.

  • Loading branch information...
1 parent 49e30ce commit e252fabb74ca56442d5c039ba265da62c28282a8 @wvanbergen wvanbergen committed Feb 7, 2014
Showing with 21 additions and 25 deletions.
  1. +21 −25 lib/statsd/instrument.rb
View
@@ -4,31 +4,6 @@
require 'statsd/instrument/version'
module StatsD
- class << self
- attr_accessor :host, :port, :mode, :logger, :enabled, :default_sample_rate,
- :prefix, :implementation
- end
-
- def self.server=(conn)
- self.host, port = conn.split(':')
- self.port = port.to_i
- invalidate_socket
- end
-
- def self.host=(host)
- @host = host
- invalidate_socket
- end
-
- def self.port=(port)
- @port = port
- invalidate_socket
- end
-
- def self.invalidate_socket
- @socket = nil
- end
-
module Instrument
def self.generate_metric_name(metric_name, callee, *args)
@@ -134,6 +109,27 @@ def remove_from_method(method, name, action)
end
class << self
+ attr_accessor :host, :port, :mode, :logger, :enabled, :default_sample_rate, :prefix, :implementation
+
+ def server=(conn)
+ self.host, port = conn.split(':')
+ self.port = port.to_i
+ invalidate_socket
+ end
+
+ def host=(host)
+ @host = host
+ invalidate_socket
+ end
+
+ def port=(port)
+ @port = port
+ invalidate_socket
+ end
+
+ def invalidate_socket
+ @socket = nil
+ end
# glork:320|ms
def measure(key, value = nil, *metric_options)

0 comments on commit e252fab

Please sign in to comment.