lib/timber/events/sql_query.rb in timber-1.0.13 vs lib/timber/events/sql_query.rb in timber-1.1.0
- old
+ new
@@ -8,19 +8,20 @@
attr_reader :sql, :time_ms, :message
def initialize(attributes)
@sql = attributes[:sql] || raise(ArgumentError.new(":sql is required"))
@time_ms = attributes[:time_ms] || raise(ArgumentError.new(":time_ms is required"))
+ @time_ms = @time_ms.round(6)
@message = attributes[:message] || raise(ArgumentError.new(":message is required"))
end
def to_hash
{sql: sql, time_ms: time_ms}
end
alias to_h to_hash
def as_json(_options = {})
- {:sql_query => to_hash}
+ {:server_side_app => {:sql_query => to_hash}}
end
end
end
end
\ No newline at end of file