diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-11-04 16:52:24 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-11-04 16:52:24 -0800 |
commit | 9d95bd12cadac030ac27e108233193b69eb160c8 (patch) | |
tree | ac468db09ce8bfa8ac899927311fbbb786f1a388 | |
parent | 1d4cc9f9329ed9b0df3791d71f303dafb34423e2 (diff) | |
download | ohai-debug_time.tar.gz |
Better format the elapsed plugin timedebug_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 <tsmith@chef.io>
-rw-r--r-- | lib/ohai/runner.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |