lib/rorvswild.rb in rorvswild-0.1.3 vs lib/rorvswild.rb in rorvswild-0.1.4
- old
+ new
@@ -78,10 +78,11 @@
def after_http_request(name, start, finish, id, payload)
request[:db_runtime] = (payload[:db_runtime] || 0).round
request[:view_runtime] = (payload[:view_runtime] || 0).round
request[:other_runtime] = compute_duration(start, finish) - request[:db_runtime] - request[:view_runtime]
error[:parameters] = filter_sensitive_data(payload[:params]) if error
+ attributes = request.merge(queries: slowest_queries, views: slowest_views, error: error)
Thread.new { post_request }
rescue => exception
log_error(exception)
end
@@ -209,11 +210,11 @@
rows = ActiveRecord::Base.connection.exec_query("EXPLAIN " + sql, "EXPLAIN", binds)
rows.map { |row| row["QUERY PLAN"] }.join("\n")
rescue => ex
end
- def post_request
- post("/requests", request: request.merge(queries: slowest_queries, views: slowest_views, error: error))
+ def post_request(attributes)
+ post("/requests", request: attributes)
rescue => exception
log_error(exception)
end
def post_job