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)


109
110
111
112
113
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 109

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



118
119
120
121
122
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 118

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

#parse_line(line) ⇒ Object



115
116
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 115

def parse_line(line)
end