Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 2 contributors
View
18 Gemfile
@@ -1,16 +1,6 @@
-source "http://rubygems.org"
-# Add dependencies required to use your gem here.
-# Example:
-# gem "activesupport", ">= 2.3.5"
+source 'https://rubygems.org'
-# Add dependencies to develop your gem here.
-# Include everything needed to run rake, tests, features, etc.
-group :development do
- # gem "rspec", "~> 2.3.0"
- gem "yard", "~> 0.6.0"
- gem "bundler", "~> 1.0.0"
- gem "jeweler", "~> 1.5.2"
- # gem "rcov", ">= 0"
-end
+gem 'jeweler', '~> 1.8'
+gem 'statsd-ruby', '~> 0.4', :git => 'https://github.com/jeremy/statsd-ruby.git'
-gem 'jamster-statsd'
+gemspec
View
46 Gemfile.lock
@@ -1,20 +1,46 @@
+GIT
+ remote: https://github.com/jeremy/statsd-ruby.git
+ revision: 825f76115e022defad3a3c46b6994efa4e11e41a
+ specs:
+ statsd-ruby (0.4.0)
+
+PATH
+ remote: .
+ specs:
+ resque-statsd (0.0.1)
+ statsd-ruby (~> 0.3)
+
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
+ diff-lcs (1.1.3)
git (1.2.5)
- jamster-statsd (0.1.0)
- jeweler (1.5.2)
- bundler (~> 1.0.0)
+ jeweler (1.8.3)
+ bundler (~> 1.0)
git (>= 1.2.5)
rake
- rake (0.8.7)
- yard (0.6.5)
+ rdoc
+ json (1.6.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
+ yard (0.7.5)
PLATFORMS
ruby
DEPENDENCIES
- bundler (~> 1.0.0)
- jamster-statsd
- jeweler (~> 1.5.2)
- yard (~> 0.6.0)
+ jeweler (~> 1.8)
+ rake
+ resque-statsd!
+ rspec
+ statsd-ruby (~> 0.4)!
+ yard
View
20 Rakefile
@@ -1,13 +1,5 @@
require 'rubygems'
-require 'bundler'
-begin
- Bundler.setup(:default, :development)
-rescue Bundler::BundlerError => e
- $stderr.puts e.message
- $stderr.puts "Run `bundle install` to install missing gems"
- exit e.status_code
-end
-require 'rake'
+require 'bundler/setup'
require 'jeweler'
Jeweler::Tasks.new do |gem|
@@ -19,10 +11,12 @@ Jeweler::Tasks.new do |gem|
gem.description = %Q{Will add a counter for enqueuing, performing, failing and timing Jobs}
gem.email = "jayamster@gmail.com"
gem.authors = ["Jason Amster"]
- # Include your dependencies below. Runtime dependencies are required when using your gem,
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
- # gem.add_development_dependency 'rspec', '> 1.2.3'
+
+ gem.add_runtime_dependency 'statsd-ruby', '~> 0.3'
+
+ gem.add_development_dependency 'rake'
+ gem.add_development_dependency 'yard'
+ gem.add_development_dependency 'rspec'
end
Jeweler::RubygemsDotOrgTasks.new
View
5 lib/resque/plugins/statsd.rb
@@ -8,6 +8,11 @@ def after_enqueue_statsd(*args)
end
+ def before_perform_statsd(*args)
+ $resque_statsd.increment("#{@queue}.started")
+ $resque_statsd.increment("total.started")
+ end
+
def after_perform_statsd(*args)
$resque_statsd.increment("#{@queue}.finished")
$resque_statsd.increment("total.finished")
View
16 resque-statsd.gemspec
@@ -0,0 +1,16 @@
+Gem::Specification.new do |s|
+ s.name = 'resque-statsd'
+ s.version = '0.0.1'
+ s.author = 'Jason Amster'
+ s.email = 'jayamster@gmail.com'
+ s.summary = 'Resque Statsd is a Resque plugin that will collect and send data samples from your Resque Jobs to statsd'
+
+ s.add_runtime_dependency('statsd-ruby', '~> 0.3')
+ s.add_development_dependency('rake')
+ s.add_development_dependency('yard')
+ s.add_development_dependency('rspec')
+
+ s.files = Dir['lib/**/*']
+ s.require_path = 'lib'
+end
+

No commit comments for this range

Something went wrong with that request. Please try again.