rpush-plugin-statsd 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 65b3e72cb743f10f9850755ff20a2bc21a043b1f
4
+ data.tar.gz: c9058a9a1571e5c7e47f900adcc1de28a2503908
5
+ SHA512:
6
+ metadata.gz: dbffcef1fdc5a73442cd133e8edd2206754d5fbb5b5d6d4cc95456fb0266fd3b4e74ffe092e4887f7acdd88c961b645cbe7c4ce1914191a7b99b6ed67b5e5e8c
7
+ data.tar.gz: 9e6fc8cca97011d7bdba8c7f737659d47ec6c7351d3d18c82f0dd791f4bca4116663bab4f5217110b6cf6f21e457545040995434b55f78661e5cd63dab9f41fe
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rubocop.yml ADDED
@@ -0,0 +1,21 @@
1
+ AllCops:
2
+ Exclude:
3
+ - lib/generators/**/*
4
+
5
+ LineLength:
6
+ Enabled: false
7
+
8
+ StringLiterals:
9
+ Enabled: false
10
+
11
+ Documentation:
12
+ Enabled: false
13
+
14
+ MethodLength:
15
+ Enabled: false
16
+
17
+ ClassLength:
18
+ Enabled: false
19
+
20
+ CyclomaticComplexity:
21
+ Enabled: false
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ rpush-plugin-statsd
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.0
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rubocop'
4
+
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Ian Leitch
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Rpush::Plugin::Statsd
2
+
3
+ A plugin that instruments Rpush and sends metrics to StatsD.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'rpush-plugin-statsd'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install rpush-plugin-statsd
20
+
21
+ ## Configuration
22
+
23
+ ```
24
+ Rpush.config do |config
25
+ config.plugin.statsd do |statsd|
26
+ statsd.host = "127.0.0.1"
27
+ statsd.port = 9125
28
+ end
29
+ end
30
+ ```
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it ( https://github.com/[my-github-username]/rpush-plugin-statsd/fork )
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,27 @@
1
+ require 'statsd'
2
+
3
+ plugin = Rpush.plugin(:statsd)
4
+ plugin.url = 'https://github.com/rpush/rpush-plugin-statsd'
5
+ plugin.description = 'Rpush plugin to sends stats to StatsD.'
6
+
7
+ plugin.configure do |config|
8
+ config.host = 'localhost'
9
+ config.port = 9125
10
+ end
11
+
12
+ REFLECTIONS = [:error, :apns_feedback, :notification_enqueued, :notification_delivered,
13
+ :notification_failed, :notification_id_failed, :notification_will_retry,
14
+ :notification_id_will_retry, :tcp_connection_lost, :gcm_delivered_to_recipient,
15
+ :gcm_failed_to_recipient, :gcm_invalid_registration_id, :adm_failed_to_recipient]
16
+
17
+ plugin.reflect do |on|
18
+ REFLECTIONS.each do |reflection|
19
+ block = -> { @statsd.increment(reflection) }
20
+ on.send(reflection, &block)
21
+ end
22
+ end
23
+
24
+ plugin.init do
25
+ @statsd = ::Statsd.new(plugin.config.host, plugin.config.port)
26
+ @statsd.namespace = 'rpush'
27
+ end
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ Gem::Specification.new do |spec|
3
+ spec.name = "rpush-plugin-statsd"
4
+ spec.version = '0.0.1'
5
+ spec.authors = ["Ian Leitch"]
6
+ spec.email = ["port001@gmail.com"]
7
+ spec.summary = 'Rpush plugin for StatsD.'
8
+ spec.description = 'Instrument Rpush with StatsD.'
9
+ spec.homepage = "https://github.com/rpush/rpush-plugin-statsd"
10
+ spec.license = "MIT"
11
+
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_dependency "statsd-ruby"
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.7"
20
+ spec.add_development_dependency "rake", "~> 10.0"
21
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rpush-plugin-statsd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ian Leitch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: statsd-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Instrument Rpush with StatsD.
56
+ email:
57
+ - port001@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - ".ruby-gemset"
65
+ - ".ruby-version"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - lib/rpush/plugin/statsd.rb
71
+ - rpush-plugin-statsd.gemspec
72
+ homepage: https://github.com/rpush/rpush-plugin-statsd
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.4.5
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Rpush plugin for StatsD.
96
+ test_files: []