Sha256: ab5fb222e364754877fed11630efb318b68fd129183bab40df04054fea86ff96
Contents?: true
Size: 1.27 KB
Versions: 14
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true module PlainApm module Hooks class ActiveSupport < ActiveSupportSubscriber NOTIFICATION_PATTERN = /\Acache_[\w?]+\.active_support\Z/.freeze private def notification_pattern NOTIFICATION_PATTERN end def payload(event) name, base = attributes_from_notification(event) payload = event.payload base["store"] = payload[:store] case name when "cache_read" base.merge({ "key" => payload[:key], "hit" => payload[:hit], "trigger" => payload[:super_operation] }) when "cache_read_multi" base.merge({ "keys" => payload[:key], "hits" => payload[:hits] }) when "cache_fetch_hit" base.merge({ "key" => payload[:key], "hit" => true }) when "cache_write", "cache_write_multi", "cache_generate", "cache_delete", "cache_delete_matched", "cache_exist?" base.merge({ "key" => payload[:key] }) when "cache_increment", "cache_decrement" base.merge({ "key" => payload[:key], "amount" => payload[:amount] }) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems