Class: Fluent::DockerMetricsInput::BlkioStatsParser

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

Constant Summary collapse

BlkioLineRegexp =
/^(?<major>\d+):(?<minor>\d+) (?<key>[^ ]+) (?<value>\d+)/

Instance Method Summary collapse

Methods inherited from CGroupStatsParser

#initialize, #parse_each_line

Constructor Details

This class inherits a constructor from Fluent::DockerMetricsInput::CGroupStatsParser

Instance Method Details

#parse_line(line) ⇒ Object



152
153
154
155
156
157
158
159
# File 'lib/fluent/plugin/in_docker_metrics.rb', line 152

def parse_line(line)
  m = BlkioLineRegexp.match(line)
  if m
    { 'key' => @metric_type + "_" + m["key"].downcase, 'value' => m["value"].to_i }
  else
    nil
  end
end