lib/fluent/plugin/out_metricsense.rb in fluent-plugin-metricsense-0.2.1 vs lib/fluent/plugin/out_metricsense.rb in fluent-plugin-metricsense-0.2.2

- old
+ new

@@ -59,10 +59,12 @@ config_param :remove_tag_prefix, :string, :default => nil config_param :add_tag_prefix, :string, :default => nil config_param :backend, :string + config_param :aggregate_interval, :integer, :default => 60 + def configure(conf) super if @remove_tag_prefix @remove_tag_prefix = Regexp.new('^' + Regexp.escape(@remove_tag_prefix) + "\\.?") @@ -201,10 +203,10 @@ def write(chunk) counters = {} # select sum(value) from chunk group by tag, time/60, seg_val, seg_key chunk.msgpack_each {|tag,time,value,segments,update_mode| - time = time / 60 * 60 + time = time / @aggregate_interval * @aggregate_interval case update_mode when UpdateMode::ADD updater = AddUpdater when UpdateMode::MAX