newrelic_moped 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # Newrelic::Moped
1
+ # New Relic Moped
2
2
 
3
- TODO: Write a gem description
3
+ New Relic instrumentation for Moped / Mongoid 3
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'newrelic-moped'
9
+ gem 'newrelic_moped'
10
10
 
11
11
  And then execute:
12
12
 
@@ -14,11 +14,7 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install newrelic-moped
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
17
+ $ gem install newrelic_moped
22
18
 
23
19
  ## Contributing
24
20
 
@@ -12,14 +12,19 @@ DependencyDetection.defer do
12
12
  executes do
13
13
  Moped::Node.class_eval do
14
14
  def process_with_newrelic_trace(operation, &callback)
15
-
16
- self.class.trace_execution_scoped(["Moped/Node/process"]) do
15
+ collection = operation.collection
16
+
17
+ self.class.trace_execution_scoped(["Moped::process[#{collection}]"]) do
17
18
  t0 = Time.now
18
19
 
19
20
  begin
20
21
  process_without_newrelic_trace(operation, &callback)
21
22
  ensure
22
- NewRelic::Agent.instance.transaction_sampler.notice_nosql(operation.log_inspect, (Time.now - t0).to_f)
23
+ elapsed_time = (Time.now - t0).to_f
24
+ NewRelic::Agent.instance.transaction_sampler.notice_sql(operation.log_inspect,
25
+ nil, elapsed_time)
26
+ NewRelic::Agent.instance.sql_sampler.notice_sql(operation.log_inspect, nil,
27
+ nil, elapsed_time)
23
28
  end
24
29
  end
25
30
  end
@@ -1,3 +1,3 @@
1
1
  module NewrelicMoped
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_moped
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-22 00:00:00.000000000 Z
12
+ date: 2012-07-26 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: New Relic Instrumentation for Moped & Mongoid 3
15
15
  email: