Class: Cassie::Statements::Logging::ExecuteEvent

Inherits:
ActiveSupport::Notifications::Event
  • Object
show all
Defined in:
lib/cassie/statements/logging/execute_event.rb

Defined Under Namespace

Modules: Inspector

Instance Method Summary collapse

Instance Method Details

#durationObject

in milliseconds



4
5
6
7
8
9
# File 'lib/cassie/statements/logging/execute_event.rb', line 4

def duration # in milliseconds
  return super unless traced?

  # trace duration is in microseconds
  trace.duration / 1000.0
end

#messageObject



11
12
13
14
15
16
17
18
# File 'lib/cassie/statements/logging/execute_event.rb', line 11

def message
  {
    event: "cassie.cql.execution",
    duration: duration.round(1),
    query: statement,
    consistency: consistency.upcase
  }.extend(Inspector)
end