From 9d95bd12cadac030ac27e108233193b69eb160c8 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 4 Nov 2020 16:52:24 -0800 Subject: Better format the elapsed plugin time Some of it was being printed in scientific notation depending on the elapsed time. Always print as a float and only show 6 digits. This makes it easier to sort and to reason with. Signed-off-by: Tim Smith --- lib/ohai/runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb index de478895..f9dd248f 100644 --- a/lib/ohai/runner.rb +++ b/lib/ohai/runner.rb @@ -66,7 +66,7 @@ module Ohai logger.trace("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}") end end - logger.trace("Plugin #{plugin.name} took #{elapsed} seconds to run.") + logger.trace("Plugin #{plugin.name} took #{"%f" % elapsed.truncate(6)} seconds to run.") end # @param [Ohai::DSL::Plugin] plugin -- cgit v1.2.1