Method: Fluent::Plugin::Output#statistics

Defined in:
lib/fluent/plugin/output.rb

#statisticsObject



1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
# File 'lib/fluent/plugin/output.rb', line 1579

def statistics
  stats = {
    'emit_records' => @emit_records_metrics.get,
    'emit_size' => @emit_size_metrics.get,
    # Respect original name
    # https://github.com/fluent/fluentd/blob/45c7b75ba77763eaf87136864d4942c4e0c5bfcd/lib/fluent/plugin/in_monitor_agent.rb#L284
    'retry_count' => @num_errors_metrics.get,
    'emit_count' => @emit_count_metrics.get,
    'write_count' => @write_count_metrics.get,
    'rollback_count' => @rollback_count_metrics.get,
    'slow_flush_count' => @slow_flush_count_metrics.get,
    'flush_time_count' => @flush_time_count_metrics.get,
  }

  if @buffer && @buffer.respond_to?(:statistics)
    (@buffer.statistics['buffer'] || {}).each do |k, v|
      stats[BUFFER_STATS_KEYS[k]] = v
    end
  end

  { 'output' => stats }
end