fluent-plugin-aggregate 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c02851919e0b692dc10b5381aa9930450a618f2b2362daca4ff92bae2daebcaa
4
- data.tar.gz: ff6434cb1a3424d7372da9f915ea4792f22c8a072c3563da405ba66f7b811dd9
3
+ metadata.gz: ff4262edfbc1945927d465b1f34e38278d13484d398aad2b9173d7c220fa84f2
4
+ data.tar.gz: 2420c8fe2fc068c687f079160b715f5a2aff241ea93e683778914a013d368480
5
5
  SHA512:
6
- metadata.gz: c4e83ddfa0cc700645a83a64bf08a965b4137df8047da63404625daa9fa1d42a7d2f18a9f6ef6233434dbef175e0530b65da5ed6279d6d1b8e51a5a12d76568b
7
- data.tar.gz: 90169ab3b44ce01388a53893803b57b182c6240ea405971be46c3046b20e5076afb505134589793af4bbc93f42e5f0c16e1b1317113d86ddb849668f397e5bae
6
+ metadata.gz: 9709940af312a262d055e5385778152cc9311db64b7d367d2c8b6af09c96ef1a7190c95efb23096ffb02b1c6f6865cf8a43adbb67a0f0e5274d40e296dcce5cf
7
+ data.tar.gz: a47d4d91bf545dfd2d914aa623cffb4484851a4a0080c7da01327babeca1188cf81a31c8ed7da989d2418526226b130a75070242bb284bf05a5ab189fc2f397b
@@ -20,12 +20,17 @@ module Fluent
20
20
  config_param :emit_original_message, :bool, :default => true
21
21
  config_param :aggregate_event_tag, :string, :default => 'aggregate'
22
22
  config_param :aggregations, :array, :default => ['sum','min','max','mean','median','variance','standard_deviation'], value_type: :string
23
+ config_param :histogram_buckets, :array, :default => [], value_type: :integer
24
+ config_param :histogram_fields, :array, :default => [], value_type: :string
25
+ config_param :histogram_cumulative, :bool, :default => false
26
+ config_param :histogram_bucket_infinite_enabled, :bool, :default => false
27
+ config_param :histogram_bucket_comparation, :string, :default => 'less_or_equal'
23
28
  config_param :temporary_status_file_path, :string, :default => nil, :desc => 'File to store aggregate information when the agent down'
24
29
  config_param :load_temporarystatus_file_enabled, :bool, :default => true, :desc => 'Enable load saved data from file (if exist status file)'
25
30
  config_param :processing_mode, :string, :default => 'online', :desc => 'Processing mode (batch/online)'
26
31
  config_param :time_started_mode, :string, :default => 'first_event', :desc => 'Time started mode (first_event/last_event)'
27
32
 
28
- VALID_AGGREGATIONS = ['sum','min','max','mean','median','variance','standard_deviation']
33
+ VALID_AGGREGATIONS = ['sum','min','max','mean','median','variance','standard_deviation','histogram']
29
34
 
30
35
  def initialize
31
36
  super
@@ -58,10 +63,16 @@ module Fluent
58
63
 
59
64
  @aggregation_names.each {|operation|
60
65
  if ! VALID_AGGREGATIONS.include?(operation)
61
- raise Fluent::ConfigError, "aggregations must set any combination of sum,min,max,mean,median,variance,standard_deviation "
66
+ raise Fluent::ConfigError, "aggregations must set any combination of sum,min,max,mean,median,variance,standard_deviation,histogram"
62
67
  end
63
68
  }
64
69
 
70
+ if @aggregation_names.include?("histogram") && (histogram_buckets.empty? || histogram_fields.empty?)
71
+ log.warn "histogram aggregation disabled, need histogram_buckets & histogram_fields parameters to work, please review documentation."
72
+ else
73
+ log.info "histogram aggregation enabled, bucket count histogram_fields with values (le|ge) histogram_buckets parameter"
74
+ end
75
+
65
76
  @aggregator = {}
66
77
  if load_temporarystatus_file_enabled && ! @temporary_status_file_path.nil? && File.exist?(@temporary_status_file_path) && file_status = File.open(@temporary_status_file_path,'r')
67
78
  begin
@@ -82,6 +93,7 @@ module Fluent
82
93
  @aggregator_mutex = Mutex.new
83
94
  @processing_mode_type=@processing_mode=='batch' ? :batch : :online
84
95
  @time_started_mode_type=@time_started_mode=='first_event' ? :fist_event : :last_event
96
+ @histogram_bucket_comparation_mode=@histogram_bucket_comparation=='less_or_equal' ? :less_or_equal : :greater_or_equal
85
97
  @data_operations = DataOperations::Aggregate.new(aggregator: @aggregator,
86
98
  time_format: @time_format,
87
99
  time_field: @time_field,
@@ -96,7 +108,13 @@ module Fluent
96
108
  aggregator_name: @aggregator_name,
97
109
  aggregation_names: @aggregation_names,
98
110
  group_field_names: @group_field_names,
99
- aggregate_field_names: @aggregate_field_names)
111
+ aggregate_field_names: @aggregate_field_names,
112
+ histogram_buckets: @histogram_buckets,
113
+ histogram_fields: @histogram_fields,
114
+ histogram_cumulative: @histogram_cumulative,
115
+ histogram_bucket_infinite_enabled: @histogram_bucket_infinite_enabled,
116
+ histogram_bucket_comparation: @histogram_bucket_comparation_mod
117
+ )
100
118
  end
101
119
 
102
120
  def filter(tag, time, record)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-aggregate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - superguillen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2023-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.0.1
39
+ version: 0.0.7
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.0.1
46
+ version: 0.0.7
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.0.3
104
+ rubygems_version: 3.0.3.1
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Filter aggregtation plugin for Fluent