class Fluent::Plugin::NodeExporter::MetricsCollector
Public Class Methods
new(config={})
click to toggle source
# File lib/fluent/plugin/node_exporter/collector.rb, line 23 def initialize(config={}) @scrape_interval = config[:scrape_interval] || 5 @procfs_path = config[:procfs_path] || "/proc" @sysfs_path = config[:sysfs_path] || "/sys" end
Public Instance Methods
cmetrics()
click to toggle source
# File lib/fluent/plugin/node_exporter/collector.rb, line 35 def cmetrics raise NotImplementedError end
scan_sysfs_path(pattern)
click to toggle source
# File lib/fluent/plugin/node_exporter/collector.rb, line 29 def scan_sysfs_path(pattern) Dir.glob(File.join(@sysfs_path, pattern)).sort do |a, b| File.basename(a).delete("a-z").to_i <=> File.basename(b).delete("a-z").to_i end end