fluent-plugin-google-cloud 0.10.9 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +133 -108
- data/Rakefile +6 -5
- data/fluent-plugin-google-cloud.gemspec +21 -22
- data/lib/fluent/plugin/common.rb +42 -29
- data/lib/fluent/plugin/filter_add_insert_ids.rb +1 -14
- data/lib/fluent/plugin/filter_analyze_config.rb +73 -48
- data/lib/fluent/plugin/in_object_space_dump.rb +1 -1
- data/lib/fluent/plugin/monitoring.rb +49 -20
- data/lib/fluent/plugin/out_google_cloud.rb +270 -213
- data/lib/fluent/plugin/statusz.rb +10 -10
- data/test/helper.rb +6 -0
- data/test/plugin/base_test.rb +200 -136
- data/test/plugin/constants.rb +21 -28
- data/test/plugin/test_driver.rb +2 -1
- data/test/plugin/test_filter_add_insert_ids.rb +5 -3
- data/test/plugin/test_filter_analyze_config.rb +32 -17
- data/test/plugin/test_out_google_cloud.rb +37 -25
- data/test/plugin/test_out_google_cloud_grpc.rb +45 -30
- data/test/plugin/utils.rb +9 -8
- metadata +58 -44
@@ -19,14 +19,16 @@ require 'erb'
|
|
19
19
|
module Statusz
|
20
20
|
module_function
|
21
21
|
|
22
|
-
# Note: The plugin parameter is referenced in STATUSZ_TMPL.
|
23
22
|
def response(plugin)
|
24
23
|
uptime = Time.now - SERVER_START
|
25
|
-
uptime_str = format('
|
26
|
-
uptime / 3600,
|
27
|
-
(uptime / 60) % 60,
|
28
|
-
uptime % 60)
|
29
|
-
ERB.new(STATUSZ_TMPL).
|
24
|
+
uptime_str = format('%<hours>d hr %<minutes>02d min %<seconds>02d sec',
|
25
|
+
hours: uptime / 3600,
|
26
|
+
minutes: (uptime / 60) % 60,
|
27
|
+
seconds: uptime % 60)
|
28
|
+
ERB.new(STATUSZ_TMPL).result_with_hash(
|
29
|
+
plugin: plugin,
|
30
|
+
uptime_str: uptime_str
|
31
|
+
)
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
@@ -34,7 +36,7 @@ SERVER_START = Time.now
|
|
34
36
|
|
35
37
|
# Does not include the following deprecated config params:
|
36
38
|
# auth_method, private_key_email, private_key_passphrase, private_key_path
|
37
|
-
CONFIG_KEYS = %w
|
39
|
+
CONFIG_KEYS = %w[
|
38
40
|
adjust_invalid_timestamps
|
39
41
|
autoformat_stackdriver_trace
|
40
42
|
coerce_to_utf8
|
@@ -68,9 +70,8 @@ CONFIG_KEYS = %w(
|
|
68
70
|
vm_id
|
69
71
|
vm_name
|
70
72
|
zone
|
71
|
-
|
73
|
+
].freeze
|
72
74
|
|
73
|
-
# rubocop:disable LineLength
|
74
75
|
STATUSZ_TMPL = %(\
|
75
76
|
<!DOCTYPE html>
|
76
77
|
<html>
|
@@ -121,4 +122,3 @@ STATUSZ_TMPL = %(\
|
|
121
122
|
</body>
|
122
123
|
</html>
|
123
124
|
).freeze
|
124
|
-
# rubocop:enable LineLength
|
data/test/helper.rb
CHANGED
@@ -17,8 +17,10 @@ require 'bundler'
|
|
17
17
|
begin
|
18
18
|
Bundler.setup(:default, :development)
|
19
19
|
rescue Bundler::BundlerError => e
|
20
|
+
# rubocop:disable Style/StderrPuts
|
20
21
|
$stderr.puts e.message
|
21
22
|
$stderr.puts 'Run `bundle install` to install missing gems'
|
23
|
+
# rubocop:enable Style/StderrPuts
|
22
24
|
exit e.status_code
|
23
25
|
end
|
24
26
|
require 'test/unit'
|
@@ -29,6 +31,10 @@ require 'fluent/test'
|
|
29
31
|
unless ENV.key?('VERBOSE')
|
30
32
|
nulllogger = Object.new
|
31
33
|
nulllogger.instance_eval do |_|
|
34
|
+
def respond_to_missing?(_method, _include_private = false)
|
35
|
+
true
|
36
|
+
end
|
37
|
+
|
32
38
|
def method_missing(_method, *_args)
|
33
39
|
# pass
|
34
40
|
end
|