Module: AppPerfAgent::Plugin

Defined in:
lib/app_perf_agent/plugin.rb,
lib/app_perf_agent/plugin/base.rb,
lib/app_perf_agent/plugin/system/cpu.rb,
lib/app_perf_agent/plugin/system/disk.rb,
lib/app_perf_agent/plugin/system/load.rb,
lib/app_perf_agent/plugin/system/memory.rb,
lib/app_perf_agent/plugin/system/network.rb

Defined Under Namespace

Modules: System Classes: Base

Class Method Summary collapse

Class Method Details

.load_pluginsObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/app_perf_agent/plugin.rb', line 4

def load_plugins
  pattern = File.join(File.dirname(__FILE__), 'plugin', '**', '*.rb')

  Dir.glob(pattern) do |f|
    begin
      require f
    rescue => e
      AppPerfAgent.logger.info "Error loading plugin '#{f}' : #{e}"
      AppPerfAgent.logger.info "#{e.backtrace.first}"
    end
  end
end

.pluginsObject



17
18
19
20
21
# File 'lib/app_perf_agent/plugin.rb', line 17

def plugins
  @plugins ||= ::AppPerfAgent::Plugin::Base
    .descendants
    .map(&:new)
end