Sha256: d4bd3a34080a97617921070ddc9a8327bd60110ea43c8d828bc310504608a9ea

Contents?: true

Size: 426 Bytes

Versions: 10

Compression:

Stored size: 426 Bytes

Contents

module PlainApm
  module Helpers
    def plain_apm_context(context = {})
      PlainApm::Extensions::Context.context.merge!(context)
    end

    def plain_apm_instrument(name, context = {}, &block)
      sanitized_name = name.gsub(/\W/, "_").gsub(/(?!^)([A-Z])/) { |m| "_#{m}" }.gsub(/_+/, "_").downcase
      ActiveSupport::Notifications.instrument("#{sanitized_name}.manual.plain_apm", **context, &block)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
plain_apm-0.6.1 lib/plain_apm/helpers.rb
plain_apm-0.5.7 lib/plain_apm/helpers.rb
plain_apm-0.5.6 lib/plain_apm/helpers.rb
plain_apm-0.5.5 lib/plain_apm/helpers.rb
plain_apm-0.5.4 lib/plain_apm/helpers.rb
plain_apm-0.5.3 lib/plain_apm/helpers.rb
plain_apm-0.5.2 lib/plain_apm/helpers.rb
plain_apm-0.5.1 lib/plain_apm/helpers.rb
plain_apm-0.5.0 lib/plain_apm/helpers.rb
plain_apm-0.4.0 lib/plain_apm/helpers.rb