Class: Logtail::Events::SQLQuery
- Inherits:
-
Logtail::Event
- Object
- Logtail::Event
- Logtail::Events::SQLQuery
- Defined in:
- lib/logtail/events/sql_query.rb
Instance Attribute Summary collapse
-
#duration_ms ⇒ Object
readonly
Returns the value of attribute duration_ms.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#sql ⇒ Object
readonly
Returns the value of attribute sql.
Attributes inherited from Logtail::Event
Instance Method Summary collapse
-
#initialize(attributes) ⇒ SQLQuery
constructor
A new instance of SQLQuery.
- #to_hash ⇒ Object
Methods inherited from Logtail::Event
#inspect, #to_json, #to_msgpack, #to_s
Constructor Details
#initialize(attributes) ⇒ SQLQuery
Returns a new instance of SQLQuery.
10 11 12 13 14 |
# File 'lib/logtail/events/sql_query.rb', line 10 def initialize(attributes) @sql = attributes[:sql] @duration_ms = attributes[:duration_ms] @message = attributes[:message] end |
Instance Attribute Details
#duration_ms ⇒ Object (readonly)
Returns the value of attribute duration_ms.
8 9 10 |
# File 'lib/logtail/events/sql_query.rb', line 8 def duration_ms @duration_ms end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/logtail/events/sql_query.rb', line 8 def @message end |
#sql ⇒ Object (readonly)
Returns the value of attribute sql.
8 9 10 |
# File 'lib/logtail/events/sql_query.rb', line 8 def sql @sql end |
Instance Method Details
#to_hash ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/logtail/events/sql_query.rb', line 16 def to_hash { sql_query_executed: Util::NonNilHashBuilder.build do |h| h.add(:sql, sql) h.add(:duration_ms, duration_ms) end } end |