scout_rails 0.0.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown
CHANGED
data/README.markdown
CHANGED
@@ -1,14 +1,8 @@
|
|
1
1
|
# ScoutRails
|
2
2
|
|
3
|
-
A Ruby gem for detailed Rails application performance analysis. Metrics are reported to [Scout](https://scoutapp.com), a hosted server and application monitoring service. For general server monitoring, see our [server monitoring agent](https://github.com/
|
3
|
+
A Ruby gem for detailed Rails application performance analysis. Metrics are reported to [Scout](https://scoutapp.com), a hosted server and application monitoring service. For general server monitoring, see our [server monitoring agent](https://github.com/scoutapp/scout-client).
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Rails Monitoring is only available to existing Scout customers. [Contact us](mailto:support@scoutapp.com) if you'd like to be in our BETA group.
|
8
|
-
|
9
|
-
## Screenshot
|
10
|
-
|
11
|
-
![Scout Rails Monitoring](http://dl.dropbox.com/u/468982/scout_rails_screenshot_gem.gif)
|
5
|
+
![Scout Rails Monitoring](https://img.skitch.com/20120714-frkr9i1pyjgn58uqrwqh55yfb8.jpg)
|
12
6
|
|
13
7
|
## Getting Started
|
14
8
|
|
@@ -26,6 +20,7 @@ Signup for a [Scout](https://scoutapp.com) account and copy the config file to R
|
|
26
20
|
|
27
21
|
* Ruby 1.8.7
|
28
22
|
* Ruby 1.9.2
|
23
|
+
* Ruby 1.9.3
|
29
24
|
|
30
25
|
## Supported Application Servers
|
31
26
|
|
@@ -33,5 +28,6 @@ Signup for a [Scout](https://scoutapp.com) account and copy the config file to R
|
|
33
28
|
* Thin
|
34
29
|
* WEBrick
|
35
30
|
|
31
|
+
## Help
|
36
32
|
|
37
|
-
|
33
|
+
See our [troubleshooting tips](https://scoutapp.com/info/support_app_monitoring) and/or email support@scoutapp.com if you need a hand.
|
@@ -30,6 +30,7 @@ if defined?(ActionController) && defined?(ActionController::Base)
|
|
30
30
|
|
31
31
|
def rescue_action_with_scout(exception)
|
32
32
|
ScoutRails::Agent.instance.store.track!("Errors/Request",1, :scope => nil)
|
33
|
+
ScoutRails::Agent.instance.store.ignore_transaction!
|
33
34
|
rescue_action_without_scout exception
|
34
35
|
end
|
35
36
|
|
data/lib/scout_rails/store.rb
CHANGED
@@ -20,12 +20,16 @@ class ScoutRails::Store
|
|
20
20
|
# Called when the last stack item completes for the current transaction to clear
|
21
21
|
# for the next run.
|
22
22
|
def reset_transaction!
|
23
|
-
Thread::current[:
|
23
|
+
Thread::current[:ignore_transaction] = nil
|
24
24
|
Thread::current[:scout_scope_name] = nil
|
25
25
|
@transaction_hash = Hash.new
|
26
26
|
@stack = Array.new
|
27
27
|
end
|
28
28
|
|
29
|
+
def ignore_transaction!
|
30
|
+
Thread::current[:ignore_transaction] = true
|
31
|
+
end
|
32
|
+
|
29
33
|
# Called at the start of Tracer#instrument:
|
30
34
|
# (1) Either finds an existing MetricStats object in the metric_hash or
|
31
35
|
# initialize a new one. An existing MetricStats object is present if this +metric_name+ has already been instrumented.
|
@@ -40,15 +44,15 @@ class ScoutRails::Store
|
|
40
44
|
def stop_recording(sanity_check_item, options={})
|
41
45
|
item = stack.pop
|
42
46
|
stack_empty = stack.empty?
|
43
|
-
#
|
44
|
-
if Thread::current[:
|
47
|
+
# if ignoring the transaction, the item is popped but nothing happens.
|
48
|
+
if Thread::current[:ignore_transaction]
|
45
49
|
return
|
46
50
|
end
|
47
51
|
# unbalanced stack check - unreproducable cases have seen this occur. when it does, sets a Thread variable
|
48
52
|
# so we ignore further recordings. +Store#reset_transaction!+ resets this.
|
49
53
|
if item != sanity_check_item
|
50
54
|
ScoutRails::Agent.instance.logger.warn "Scope [#{Thread::current[:scout_scope_name]}] Popped off stack: #{item.inspect} Expected: #{sanity_check_item.inspect}. Aborting."
|
51
|
-
|
55
|
+
ignore_transaction!
|
52
56
|
return
|
53
57
|
end
|
54
58
|
duration = Time.now - item.start_time
|
@@ -113,7 +117,7 @@ class ScoutRails::Store
|
|
113
117
|
# Stores the slowest transaction. This will be sent to the server.
|
114
118
|
def store_sample(uri,transaction_hash,parent_meta,parent_stat,options = {})
|
115
119
|
@transaction_sample_lock.synchronize do
|
116
|
-
if parent_stat.total_call_time
|
120
|
+
if parent_stat.total_call_time >= 2 and (@sample.nil? or (@sample and parent_stat.total_call_time > @sample.total_call_time))
|
117
121
|
@sample = ScoutRails::TransactionSample.new(uri,parent_meta.metric_name,parent_stat.total_call_time,transaction_hash.dup)
|
118
122
|
end
|
119
123
|
end
|
data/lib/scout_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-07-16 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Monitors a Ruby on Rails application and reports detailed metrics on
|
16
16
|
performance to Scout, a hosted monitoring service.
|