newrelic_moped 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -8
- data/lib/newrelic_moped/instrumentation.rb +8 -3
- data/lib/newrelic_moped/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# New Relic Moped
|
2
2
|
|
3
|
-
|
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 '
|
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
|
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
|
-
|
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
|
-
|
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
|
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.
|
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-
|
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:
|