adhearsion-stats 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e4fbf9ca057c0cbe92412cff1f6a1ab85f58053
4
- data.tar.gz: 1d37fa47b5ebe836f6120c72ce1b7d48d349f841
3
+ metadata.gz: b43b2a63b968196b960898cf232ed8b43d9b0b9c
4
+ data.tar.gz: aba3f622460cbb6ae135b7ce53e06c10d334590f
5
5
  SHA512:
6
- metadata.gz: f908cd4cd9bf66a838c83e6618444aee53981b3c259cb8df3a2280b4d062fcab245a6f798caf857b0460aefd2b6f6c9fe6bf8cfae92895372cb1267fb655ac37
7
- data.tar.gz: 294f120099c3d0e618e5e81f17b9021d19782e141820746e9fe0ea1fe3ebdbc1e9d025fffc130ef8b15a826b872a132b72d70c5568e0dd4f26b5e67fa45496ed
6
+ metadata.gz: 28ca54ce073ce66c0e46281aee619e3c82489eda8be50ecc9fcce04edc779d29ec412705c6899fb7ce15ef5ff3cea8f4c6f48b806fdd8f25f3de880c2bf26b0f
7
+ data.tar.gz: 80405b22cc6b055cf366a49c1dc410b425b0e141be71341640d111d33f5888efd9affed16ec1fe1905fefc9a0332ff5c2ab59caf62c2d75f0620a46706c58b7d
@@ -1,3 +1,6 @@
1
+ # 0.0.3
2
+ * Use a single UDP Socket to send stats
3
+
1
4
  # 0.0.2
2
5
  * BUGFIX: Log location relative to `Adhearsion.root`
3
6
 
@@ -5,9 +5,9 @@ require "adhearsion-stats/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "adhearsion-stats"
7
7
  s.version = AdhearsionStats::VERSION
8
- s.authors = ["JustinAiken"]
8
+ s.authors = ["Justin Aiken"]
9
9
  s.email = ["jaiken@mojolingo.com"]
10
- s.homepage = "https://github.com/polysics/adhearsion-stats"
10
+ s.homepage = "https://github.com/JustinAiken/adhearsion-stats"
11
11
  s.summary = %q{Adhearsion plugin for stats}
12
12
  s.description = %q{Adhearsion plugin for stats. Reports via statsd.}
13
13
  s.license = 'MIT'
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_runtime_dependency %q<adhearsion>, ["~> 2.1"]
22
- s.add_runtime_dependency %q<statsd-ruby>
22
+ s.add_runtime_dependency %q<justinaiken-statsd>
23
23
 
24
24
  s.add_development_dependency %q<coveralls>, ['>= 0']
25
25
  s.add_development_dependency %q<bundler>, ["~> 1.0"]
@@ -1,5 +1,6 @@
1
1
  module AdhearsionStats; end
2
2
 
3
3
  require "adhearsion-stats/version"
4
+ require "adhearsion-stats/stactor"
4
5
  require "adhearsion-stats/metrics_logger"
5
6
  require "adhearsion-stats/plugin"
@@ -17,9 +17,10 @@ module AdhearsionStats
17
17
  init :statsd do
18
18
  AdhearsionStats.setup_logger if Adhearsion.config.statsd.log_metrics
19
19
 
20
- AdhearsionStats.statsd = Statsd.new Adhearsion.config.statsd.host, Adhearsion.config.statsd.port
21
- AdhearsionStats.loaded = true
20
+ statsd = Statsd.new Adhearsion.config.statsd.host, Adhearsion.config.statsd.port, UDPSocket.new
21
+ AdhearsionStats.statsd = AdhearsionStats::Stactor.new statsd
22
22
 
23
+ AdhearsionStats.loaded = true
23
24
  logger.info "Adhearsion-Stats has been loaded"
24
25
  end
25
26
  end
@@ -0,0 +1,19 @@
1
+ module AdhearsionStats
2
+ class Stactor
3
+ include Celluloid
4
+
5
+ attr_accessor :statsd
6
+
7
+ def initialize(statsd)
8
+ @statsd = statsd
9
+ end
10
+
11
+ def send_stat(meth, *args, &blk)
12
+ statsd.send meth, *args, &blk
13
+ end
14
+
15
+ def method_missing(meth, *args, &blk)
16
+ self.async.send_stat meth, *args, &blk
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module AdhearsionStats
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -22,9 +22,10 @@ describe AdhearsionStats do
22
22
  end
23
23
 
24
24
  it "sets init variables" do
25
- subject.statsd.should be_an_instance_of Statsd
26
- subject.statsd.host.should == "127.0.0.1"
27
- subject.statsd.port.should == 8125
25
+ subject.statsd.should be_an_instance_of AdhearsionStats::Stactor
26
+ subject.statsd.statsd.should be_an_instance_of Statsd
27
+ subject.statsd.statsd.host.should == "127.0.0.1"
28
+ subject.statsd.statsd.port.should == 8125
28
29
 
29
30
  subject.metrics_logger.should be_an_instance_of AdhearsionStats::MetricsLogger
30
31
  subject.loaded.should be_true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adhearsion-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - JustinAiken
7
+ - Justin Aiken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-21 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adhearsion
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: statsd-ruby
28
+ name: justinaiken-statsd
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '>='
@@ -128,11 +128,12 @@ files:
128
128
  - lib/adhearsion-stats.rb
129
129
  - lib/adhearsion-stats/metrics_logger.rb
130
130
  - lib/adhearsion-stats/plugin.rb
131
+ - lib/adhearsion-stats/stactor.rb
131
132
  - lib/adhearsion-stats/version.rb
132
133
  - spec/adhearsion-stats/plugin_spec.rb
133
134
  - spec/spec_helper.rb
134
135
  - spec/support/statsd_test_helper.rb
135
- homepage: https://github.com/polysics/adhearsion-stats
136
+ homepage: https://github.com/JustinAiken/adhearsion-stats
136
137
  licenses:
137
138
  - MIT
138
139
  metadata: {}
@@ -157,3 +158,4 @@ signing_key:
157
158
  specification_version: 4
158
159
  summary: Adhearsion plugin for stats
159
160
  test_files: []
161
+ has_rdoc: