Class: Yabeda::Rails::Event

Inherits:
ActiveSupport::Notifications::Event
  • Object
show all
Defined in:
lib/yabeda/rails/event.rb

Overview

ActiveSupport Event with added logic for Yabeda tags formatting

Instance Method Summary collapse

Instance Method Details

#db_runtimeObject



28
29
30
# File 'lib/yabeda/rails/event.rb', line 28

def db_runtime
  ms2s payload[:db_runtime]
end

#durationObject



20
21
22
# File 'lib/yabeda/rails/event.rb', line 20

def duration
  ms2s super
end

#labelsObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/yabeda/rails/event.rb', line 7

def labels
  @labels ||= begin
    labels = {
      controller: controller,
      action: action,
      status: status,
      format: format,
      method: method,
    }
    labels.merge(payload.slice(*Yabeda.default_tags.keys - labels.keys))
  end
end

#view_runtimeObject



24
25
26
# File 'lib/yabeda/rails/event.rb', line 24

def view_runtime
  ms2s payload[:view_runtime]
end