summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Fisher <wfisher@chef.io>2019-07-31 16:35:04 -0700
committerWill Fisher <wfisher@chef.io>2019-07-31 16:35:04 -0700
commitdbac893eff74ad29373ba46af4e37a441a0bdb71 (patch)
treeff2eb9cdf576f17ec7c19c129f266b4b28552d6c
parent70b7b54cabef12e1cc4ac771c0952ad0c5c45eb8 (diff)
downloadohai-dbac893eff74ad29373ba46af4e37a441a0bdb71.tar.gz
Display elapsed real time instead of total cpu time
Signed-off-by: Will Fisher <wfisher@chef.io>
-rw-r--r--lib/ohai/runner.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb
index bc69bc9c..e86c6118 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -38,7 +38,7 @@ module Ohai
# If force is set to true, then this plugin and its dependencies
# will be run even if they have been run before.
def run_plugin(plugin)
- elapsed = Benchmark.measure do
+ elapsed = Benchmark.realtime do
unless plugin.is_a?(Ohai::DSL::Plugin)
raise Ohai::Exceptions::InvalidPlugin, "Invalid plugin #{plugin} (must be an Ohai::DSL::Plugin or subclass)"
end
@@ -57,7 +57,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.total} seconds to run.")
+ logger.trace("Plugin #{plugin.name} took #{elapsed} seconds to run.")
end
def run_v7_plugin(plugin)