netuitive_rails_agent 1.0.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/config/agent.yml +3 -0
- data/lib/netuitive_rails_agent/action_controller.rb +11 -8
- data/lib/netuitive_rails_agent/config_manager.rb +5 -1
- metadata +3 -4
- data/log/netuitive.log +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ee90f352cfeb37d1b2c7f8f12f97afd419505c3cb05ca1526b4db7688d6b4dbc
|
4
|
+
data.tar.gz: 68bd86e6990cd49c0a2fab3c9133497d861f61a24718d86f644ff2e48de088e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 767059630df4d7030605a6daffd7e8e64b4b7d6c99e93af94e06e1e29eda008e7ae630e2f7d13cf8a9fb6df3d926a720ab263871c2f6ce7dc0771a7ca977e594
|
7
|
+
data.tar.gz: dbd849d8dbf06823d1768266f3aefc701f784db680530f34a99161fd798fe646fa050aaac23d4c242b109d5f388ad37ccc6487cbb27a789b1f8480e6bff91973
|
data/config/agent.yml
CHANGED
@@ -26,6 +26,9 @@ sidekiqEnabled: false #NETUITIVE_RAILS_SIDEKIQ_ENABLED toggle for collection of
|
|
26
26
|
sendErrorEvents: false #NETUITIVE_RAILS_SEND_ERROR_EVENTS toggle for sending exceptions to netuitived for export as external events.
|
27
27
|
|
28
28
|
#feature configs
|
29
|
+
actionControllerWhitelist: .* #NETUITIVE_RAILS_ACTION_CONTROLLER_WHITELIST this is required to filter out action controller metrics
|
30
|
+
#Example: ^Rails::WelcomeController$
|
31
|
+
#The whitelist needs to be valid RegEx
|
29
32
|
queueTimeUnits: 1 #NETUITIVE_RAILS_QUEUE_TIME_UNITS this is the divisor required to get the queue time metric into seconds. examples: seconds: 1, milliseconds: 1000, microseconds: 1000000.
|
30
33
|
ignoredErrors: #NETUITIVE_RAILS_IGNORED_ERRORS list of exceptions to ignore. should be provided in the following yaml format:
|
31
34
|
#ignoredErrors:
|
@@ -49,17 +49,20 @@ module NetuitiveRailsAgent
|
|
49
49
|
event = ActiveSupport::Notifications::Event.new(*args)
|
50
50
|
controller = event.payload[:controller].to_s
|
51
51
|
action = event.payload[:action].to_s
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
ac_whitelist_string = NetuitiveRailsAgent::ConfigManager.action_controller_whitelist
|
53
|
+
if controller =~ /#{ac_whitelist_string}/
|
54
|
+
interaction.add_sample("action_controller.#{controller}.#{action}.request.total_duration", event.duration)
|
55
|
+
interaction.add_sample("action_controller.#{controller}.#{action}.request.query_time", event.payload[:db_runtime])
|
56
|
+
interaction.add_sample("action_controller.#{controller}.#{action}.request.view_time", event.payload[:view_runtime])
|
57
|
+
interaction.add_sample("action_controller.#{controller}.request.total_duration", event.duration)
|
58
|
+
interaction.add_sample("action_controller.#{controller}.request.query_time", event.payload[:db_runtime])
|
59
|
+
interaction.add_sample("action_controller.#{controller}.request.view_time", event.payload[:view_runtime])
|
60
|
+
interaction.aggregate_metric("action_controller.#{controller}.#{action}.total_requests", 1)
|
61
|
+
interaction.aggregate_metric("action_controller.#{controller}.total_requests", 1)
|
62
|
+
end
|
58
63
|
interaction.add_sample('action_controller.request.total_duration', event.duration)
|
59
64
|
interaction.add_sample('action_controller.request.query_time', event.payload[:db_runtime])
|
60
65
|
interaction.add_sample('action_controller.request.view_time', event.payload[:view_runtime])
|
61
|
-
interaction.aggregate_metric("action_controller.#{controller}.#{action}.total_requests", 1)
|
62
|
-
interaction.aggregate_metric("action_controller.#{controller}.total_requests", 1)
|
63
66
|
interaction.aggregate_metric('action_controller.total_requests', 1)
|
64
67
|
end
|
65
68
|
end
|
@@ -29,6 +29,8 @@ module NetuitiveRailsAgent
|
|
29
29
|
|
30
30
|
attr_accessor :object_space_enabled
|
31
31
|
|
32
|
+
attr_accessor :action_controller_whitelist
|
33
|
+
|
32
34
|
attr_accessor :data
|
33
35
|
|
34
36
|
def property(name, var, default = nil)
|
@@ -101,6 +103,7 @@ module NetuitiveRailsAgent
|
|
101
103
|
@action_errors_enabled = boolean_property('actionErrorsEnabled', 'NETUITIVE_RAILS_ACTION_ERRORS_ENABLED')
|
102
104
|
@gc_enabled = boolean_property('gcEnabled', 'NETUITIVE_RAILS_GC_ENABLED')
|
103
105
|
@object_space_enabled = boolean_property('objectSpaceEnabled', 'NETUITIVE_RAILS_OBJECT_SPACE_ENABLED')
|
106
|
+
@action_controller_whitelist = property('actionControllerWhitelist', 'NETUITIVE_RAILS_ACTION_CONTROLLER_WHITELIST')
|
104
107
|
|
105
108
|
NetuitiveRailsAgent::NetuitiveLogger.log.debug "read config file. Results:
|
106
109
|
debugLevel: #{debug_level_string},
|
@@ -117,7 +120,8 @@ module NetuitiveRailsAgent
|
|
117
120
|
request_wrapper_enabled: #{request_wrapper_enabled},
|
118
121
|
action_errors_enabled: #{action_errors_enabled},
|
119
122
|
gc_enabled: #{gc_enabled},
|
120
|
-
object_space_enabled: #{object_space_enabled}
|
123
|
+
object_space_enabled: #{object_space_enabled}
|
124
|
+
action_controller_whitelist: #{action_controller_whitelist}"
|
121
125
|
end
|
122
126
|
end
|
123
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netuitive_rails_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John King
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netuitive_ruby_api
|
@@ -66,7 +66,6 @@ files:
|
|
66
66
|
- lib/netuitive_rails_agent/request_data.rb
|
67
67
|
- lib/netuitive_rails_agent/scheduler.rb
|
68
68
|
- lib/netuitive_rails_agent/sidekiq.rb
|
69
|
-
- log/netuitive.log
|
70
69
|
homepage: http://rubygems.org/gems/netuitive_rails_agent
|
71
70
|
licenses:
|
72
71
|
- Apache-2.0
|
@@ -87,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
86
|
version: '0'
|
88
87
|
requirements: []
|
89
88
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
89
|
+
rubygems_version: 2.7.6
|
91
90
|
signing_key:
|
92
91
|
specification_version: 4
|
93
92
|
summary: Rails metrics for Netuitive's API
|
data/log/netuitive.log
DELETED
File without changes
|