Skip to content
Browse files

Rename to moped-rails-instrumentation for gem release.

  • Loading branch information...
1 parent 717a092 commit a6de12d5b21e1f0bb331973b039b4c653cf64293 @jcoene committed Nov 26, 2012
View
1 Gemfile
@@ -1,4 +1,3 @@
source "http://rubygems.org"
-# Specify your gem's dependencies in mongo-rails-instrumentation.gemspec
gemspec
View
8 README
@@ -1,14 +1,14 @@
-Mongo Rails 3 Instrumentation
+Moped Rails 3 Instrumentation
=============================
-Records how long your rails app spends in Mongo, and outputs it to the log, i.e.:
+Records how long your rails app spends in Mongo (via Moped), and outputs it to the log, i.e.:
Completed 200 OK in 1535ms (Views: 623.3ms | Mongo: 848.2ms)
To use, just add the gem to your Gemfile and restart your app:
- gem 'mongo-rails-instrumentation', '~>0.2'
+ gem 'moped-rails-instrumentation', '~>0.1'
It's been tested with rails 3.0, and should work with rails 3.1 too.
-This gem's home is on github at https://github.com/freerange/mongo-rails-instrumentation, so please add comments, suggestions and improvements there. All code is released under the MIT License.
+This gem is based on mongo-rails-instrumentation by Tom Ward, available at https://github.com/freerange/mongo-rails-instrumentation and then ported to Moped by Stan Mazurek at https://github.com/stan/mongo-rails-instrumentation. It is released here by me only to provide a gem.
View
1 lib/mongo-rails-instrumentation.rb
@@ -1 +0,0 @@
-require 'mongo/rails/instrumentation/railtie'
View
10 lib/mongo/rails/instrumentation.rb
@@ -1,10 +0,0 @@
-module Mongo
- module Rails
- module Instrumentation
- autoload :Version, 'mongo/rails/instrumentation/version'
- autoload :Railtie, 'mongo/rails/instrumentation/railtie'
- autoload :LogSubscriber, 'mongo/rails/instrumentation/log_subscriber'
- autoload :ControllerRuntime, 'mongo/rails/instrumentation/controller_runtime'
- end
- end
-end
View
1 lib/moped-rails-instrumentation.rb
@@ -0,0 +1 @@
+require 'moped/rails/instrumentation/railtie'
View
10 lib/moped/rails/instrumentation.rb
@@ -0,0 +1,10 @@
+module Moped
+ module Rails
+ module Instrumentation
+ autoload :Version, 'moped/rails/instrumentation/version'
+ autoload :Railtie, 'moped/rails/instrumentation/railtie'
+ autoload :LogSubscriber, 'moped/rails/instrumentation/log_subscriber'
+ autoload :ControllerRuntime, 'moped/rails/instrumentation/controller_runtime'
+ end
+ end
+end
View
6 ...ils/instrumentation/controller_runtime.rb → ...ils/instrumentation/controller_runtime.rb
@@ -1,6 +1,6 @@
-require 'mongo/rails/instrumentation'
+require 'moped/rails/instrumentation'
-module Mongo::Rails::Instrumentation
+module Moped::Rails::Instrumentation
module ControllerRuntime
extend ActiveSupport::Concern
@@ -34,4 +34,4 @@ def log_process_action(payload)
end
end
end
-end
+end
View
6 ...o/rails/instrumentation/log_subscriber.rb → ...d/rails/instrumentation/log_subscriber.rb
@@ -1,6 +1,6 @@
-require 'mongo/rails/instrumentation'
+require 'moped/rails/instrumentation'
-class Mongo::Rails::Instrumentation::LogSubscriber < ActiveSupport::LogSubscriber
+class Moped::Rails::Instrumentation::LogSubscriber < ActiveSupport::LogSubscriber
RUNTIME_KEY = name + "#runtime"
COUNT_KEY = name + "#count"
@@ -29,4 +29,4 @@ def mongo(event)
self.class.runtime += event.duration
self.class.count += 1
end
-end
+end
View
10 lib/mongo/rails/instrumentation/railtie.rb → lib/moped/rails/instrumentation/railtie.rb
@@ -1,8 +1,8 @@
-require 'mongo/rails/instrumentation'
+require 'moped/rails/instrumentation'
-module Mongo::Rails::Instrumentation
+module Moped::Rails::Instrumentation
class Railtie < Rails::Railtie
- initializer "mongo.rails.instrumentation" do |app|
+ initializer "moped.rails.instrumentation" do |app|
instrument Moped::Connection, [
:read,
:write
@@ -12,7 +12,7 @@ class Railtie < Rails::Railtie
include ControllerRuntime
end
- LogSubscriber.attach_to :mongo
+ LogSubscriber.attach_to :moped
end
def instrument(clazz, methods)
@@ -31,4 +31,4 @@ def #{m}_with_instrumentation(*args, &block)
end
end
end
-end
+end
View
4 lib/mongo/rails/instrumentation/version.rb → lib/moped/rails/instrumentation/version.rb
@@ -1,7 +1,7 @@
-module Mongo
+module Moped
module Rails
module Instrumentation
- VERSION = '0.2.4'
+ VERSION = '0.1'
end
end
end
View
19 mongo-rails-instrumentation.gemspec
@@ -1,19 +0,0 @@
-# -*- encoding: utf-8 -*-
-$:.push File.expand_path("../lib", __FILE__)
-require "mongo/rails/instrumentation/version"
-
-Gem::Specification.new do |s|
- s.name = "mongo-rails-instrumentation"
- s.version = Mongo::Rails::Instrumentation::VERSION
- s.platform = Gem::Platform::RUBY
- s.authors = ["Tom Ward"]
- s.email = ["tom@popdog.net"]
- s.homepage = "http://github.com/freerange/mongo-rails-instrumentation"
- s.summary = %q{Records time spent in mongo and adds to request logs}
- s.description = %q{Records time spent in mongo and adds to request logs}
-
- s.files = `git ls-files`.split("\n")
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- s.require_paths = ["lib"]
-end
View
19 moped-rails-instrumentation.gemspec
@@ -0,0 +1,19 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "moped/rails/instrumentation/version"
+
+Gem::Specification.new do |s|
+ s.name = "moped-rails-instrumentation"
+ s.version = Moped::Rails::Instrumentation::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Jason Coene"]
+ s.email = ["jcoene@gmail.com"]
+ s.homepage = "http://github.com/jcoene/moped-rails-instrumentation"
+ s.summary = %q{Records time spent in Moped for mongo and adds to request logs.}
+ s.description = %q{Records time spent in Moped for mongo and adds to request logs.}
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+end

0 comments on commit a6de12d

Please sign in to comment.
Something went wrong with that request. Please try again.