lib/sapience/extensions/grape/middleware/logging.rb in sapience-0.2.3 vs lib/sapience/extensions/grape/middleware/logging.rb in sapience-0.2.4

- old
+ new

@@ -39,15 +39,13 @@ end def parameters # rubocop:disable AbcSize { status: (response.nil? ? "fail" : response.status), - time: { - total: total_runtime, - db: db_runtime, - view: view_runtime, - }, + db_runtime: db_runtime, + view_runtime: view_runtime, + total_runtime: total_runtime, method: request.request_method, path: request.path, params: request.params, host: request.host, ip: (request.env["HTTP_X_FORWARDED_FOR"] || request.env["REMOTE_ADDR"]), @@ -60,18 +58,18 @@ def request @request ||= ::Rack::Request.new(env) end def total_runtime - ((stop_time - start_time) * 1000).round(2) + ((stop_time - start_time) * 1000).round(3) end def view_runtime total_runtime - db_runtime end def db_runtime - Grape::Timings.db_runtime.round(2) + Grape::Timings.db_runtime.round(3) end def reset_db_runtime Grape::Timings.reset_db_runtime end