lib/fluent/plugin/elasticsearch_stats/metric.rb in fluent-plugin-elasticsearch-stats-0.1.0 vs lib/fluent/plugin/elasticsearch_stats/metric.rb in fluent-plugin-elasticsearch-stats-0.2.0

- old
+ new

@@ -6,11 +6,11 @@ class Metric DEFAULT_NAME_SEPARATOR = '/' DEFAULT_TIMESTAMP_FORMAT = :iso class << self - attr_accessor :metric_prefix, :index_base_pattern, :index_base_replacement + attr_accessor :metric_prefix, :index_base_pattern, :index_base_replacement, :aggregated_index_metrics_only def name_separator @name_separator ||= DEFAULT_NAME_SEPARATOR end @@ -19,17 +19,19 @@ def timestamp_format @timestamp_format ||= DEFAULT_TIMESTAMP_FORMAT end end - attr_reader :metric_prefix, :timestamp_format, :index_base_pattern, :index_base_replacement, :name_separator + attr_reader :metric_prefix, :timestamp_format, :index_base_pattern, :index_base_replacement, + :aggregated_index_metrics_only, :name_separator - def initialize(metric_prefix: nil, timestamp_format: nil, index_base_pattern: nil, index_base_replacement: nil, + def initialize(metric_prefix: nil, timestamp_format: nil, index_base_pattern: nil, index_base_replacement: nil, aggregated_index_metrics_only: nil, name_separator: nil) @metric_prefix = metric_prefix || self.class.metric_prefix @timestamp_format = timestamp_format || self.class.timestamp_format @index_base_pattern = index_base_pattern || self.class.index_base_pattern @index_base_replacement = index_base_replacement || self.class.index_base_replacement + @aggregated_index_metrics_only = aggregated_index_metrics_only || self.class.aggregated_index_metrics_only @name_separator = name_separator || self.class.name_separator end def convert_status(status) case status.downcase