summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2016-02-01 15:49:35 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2016-02-03 12:53:51 -0800
commitf2ad59e6da9db38200d2432a4d62cc0cd51f2730 (patch)
treee389b959e0d50a6057a7d61ae1641f8ab0a412db
parent237129a0fc69430396d60a95e4c192ddec2890d0 (diff)
downloadohai-jdm/benchmark.tar.gz
Benchmarkjdm/benchmark
Not to be committed, just want to see
-rw-r--r--lib/ohai/system.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index d44c9d7c..dad16c10 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -28,6 +28,7 @@ require 'ohai/mixin/constant_helper'
require 'ohai/provides_map'
require 'ohai/hints'
require 'mixlib/shellout'
+require 'benchmark'
module Ohai
class System
@@ -94,9 +95,13 @@ module Ohai
# Then run all the version 7 plugins
begin
- @provides_map.all_plugins(attribute_filter).each { |plugin|
- @runner.run_plugin(plugin)
- }
+ Benchmark.bm do |x|
+ @provides_map.all_plugins(attribute_filter).each { |plugin|
+ x.report(plugin.name) do
+ @runner.run_plugin(plugin)
+ end
+ }
+ end
rescue Ohai::Exceptions::AttributeNotFound, Ohai::Exceptions::DependencyCycle => e
Ohai::Log.error("Encountered error while running plugins: #{e.inspect}")
raise