Class: NetuitiveRailsAgent::ActiveSupportSub
- Inherits:
-
Object
- Object
- NetuitiveRailsAgent::ActiveSupportSub
- Defined in:
- lib/netuitive_rails_agent/active_support.rb
Instance Attribute Summary collapse
-
#interaction ⇒ Object
readonly
Returns the value of attribute interaction.
Instance Method Summary collapse
- #cache_delete ⇒ Object
- #cache_fetch_hit ⇒ Object
- #cache_generate ⇒ Object
- #cache_read ⇒ Object
- #cache_write ⇒ Object
-
#initialize(interaction) ⇒ ActiveSupportSub
constructor
A new instance of ActiveSupportSub.
- #subscribe ⇒ Object
Constructor Details
#initialize(interaction) ⇒ ActiveSupportSub
Returns a new instance of ActiveSupportSub.
4 5 6 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 4 def initialize(interaction) @interaction = interaction end |
Instance Attribute Details
#interaction ⇒ Object (readonly)
Returns the value of attribute interaction.
3 4 5 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 3 def interaction @interaction end |
Instance Method Details
#cache_delete ⇒ Object
42 43 44 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 42 def cache_delete interaction.aggregate_metric('active_support.cache_delete', 1) end |
#cache_fetch_hit ⇒ Object
34 35 36 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 34 def cache_fetch_hit interaction.aggregate_metric('active_support.cache_fetch_hit', 1) end |
#cache_generate ⇒ Object
30 31 32 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 30 def cache_generate interaction.aggregate_metric('active_support.cache_generate', 1) end |
#cache_read ⇒ Object
26 27 28 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 26 def cache_read interaction.aggregate_metric('active_support.cache_read', 1) end |
#cache_write ⇒ Object
38 39 40 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 38 def cache_write interaction.aggregate_metric('active_support.cache_write', 1) end |
#subscribe ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/netuitive_rails_agent/active_support.rb', line 8 def subscribe ActiveSupport::Notifications.subscribe(/cache_read.active_support/) do |*_args| cache_read end ActiveSupport::Notifications.subscribe(/cache_generate.active_support/) do |*_args| cache_generate end ActiveSupport::Notifications.subscribe(/cache_fetch_hit.active_support/) do |*_args| cache_fetch_hit end ActiveSupport::Notifications.subscribe(/cache_write.active_support/) do |*_args| cache_write end ActiveSupport::Notifications.subscribe(/cache_delete.active_support/) do |*_args| cache_delete end end |