Class: DatabaseLogger::CommandMessage

Inherits:
Data
  • Object
show all
Defined in:
lib/middleware/database_logger.rb

Overview

Data structure for captured command metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command

Returns:

  • (Object)

    the current value of command



97
98
99
# File 'lib/middleware/database_logger.rb', line 97

def command
  @command
end

#timelineObject (readonly)

Returns the value of attribute timeline

Returns:

  • (Object)

    the current value of timeline



97
98
99
# File 'lib/middleware/database_logger.rb', line 97

def timeline
  @timeline
end

#μsObject (readonly)

Returns the value of attribute μs

Returns:

  • (Object)

    the current value of μs



97
98
99
# File 'lib/middleware/database_logger.rb', line 97

def μs
  @μs
end

Instance Method Details

#inspectObject



100
101
102
103
# File 'lib/middleware/database_logger.rb', line 100

def inspect
  cmd, duration, timeline = to_a
  format('%.6f %4dμs > %s', timeline, duration, cmd)
end