Class: Fluent::DockerMetricsInput::CGroupStatsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/in_docker_metrics.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, metric_type) ⇒ CGroupStatsParser

Returns a new instance of CGroupStatsParser.

Raises:

  • (ConfigError)


122
123
124
125
126
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 122

def initialize(path, metric_type)
  raise ConfigError if not File.exists?(path)
  @path = path
  @metric_type = metric_type
end

Instance Method Details

#parse_each_line(&block) ⇒ Object



131
132
133
134
135
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 131

def parse_each_line(&block)
  File.new(@path).each_line do |line|
    block.call(parse_line(line))
  end
end

#parse_line(line) ⇒ Object



128
129
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 128

def parse_line(line)
end