class Fluent::Plugin::NodeExporterMetricsParser

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/parser_node_exporter_metrics.rb, line 26
def configure(conf)
  super
  @unpacker = Fluent::MessagePackFactory.engine_factory.unpacker
  @parser = Fluent::Plugin::NodeExporter::CMetricsDataSchemaParser.new
end
parse(data) { |now, metrics| ... } click to toggle source
# File lib/fluent/plugin/parser_node_exporter_metrics.rb, line 36
def parse(data)
  @unpacker.feed_each(data) do |obj|
    metrics = @parser.parse(obj)
    yield Fluent::EventTime.now, metrics
  end
end
Also aliased as: parse_partial_data
parse_io(io) { |now, metrics| ... } click to toggle source
# File lib/fluent/plugin/parser_node_exporter_metrics.rb, line 45
def parse_io(io, &block)
  u = Fluent::MessagePackFactory.engine_factory.unpacker(io)
  u.each do |obj|
    metrics = @parser.parse(obj)
    yield Fluent::EventTime.now, metrics
  end
end
parse_partial_data(data)
Alias for: parse
parser_type() click to toggle source
# File lib/fluent/plugin/parser_node_exporter_metrics.rb, line 32
def parser_type
  :binary
end