summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-07-31 20:27:38 -0400
committerGitHub <noreply@github.com>2019-07-31 20:27:38 -0400
commitdb1782b61ca54c44ef687647f8f205e284229df7 (patch)
treeff2eb9cdf576f17ec7c19c129f266b4b28552d6c
parent70b7b54cabef12e1cc4ac771c0952ad0c5c45eb8 (diff)
parentdbac893eff74ad29373ba46af4e37a441a0bdb71 (diff)
downloadohai-db1782b61ca54c44ef687647f8f205e284229df7.tar.gz
Merge pull request #1392 from teknofire/get_wall_clock_time
Display elapsed real time instead of total cpu time
-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)