fluent-plugin-google-cloud 0.12.10 → 0.12.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +26 -19
- data/Rakefile +6 -5
- data/fluent-plugin-google-cloud.gemspec +9 -9
- data/lib/fluent/plugin/common.rb +42 -29
- data/lib/fluent/plugin/filter_add_insert_ids.rb +1 -11
- data/lib/fluent/plugin/filter_analyze_config.rb +65 -47
- data/lib/fluent/plugin/in_object_space_dump.rb +1 -1
- data/lib/fluent/plugin/monitoring.rb +34 -23
- data/lib/fluent/plugin/out_google_cloud.rb +222 -166
- data/lib/fluent/plugin/statusz.rb +7 -9
- data/test/helper.rb +6 -0
- data/test/plugin/base_test.rb +194 -134
- data/test/plugin/constants.rb +18 -14
- 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 +33 -21
- data/test/plugin/test_out_google_cloud_grpc.rb +35 -22
- data/test/plugin/utils.rb +8 -6
- metadata +29 -29
@@ -19,13 +19,13 @@ require 'erb'
|
|
19
19
|
module Statusz
|
20
20
|
module_function
|
21
21
|
|
22
|
-
#
|
22
|
+
# NOTE: The plugin parameter is referenced in STATUSZ_TMPL.
|
23
23
|
def response(plugin)
|
24
24
|
uptime = Time.now - SERVER_START
|
25
|
-
uptime_str = format('
|
26
|
-
uptime / 3600,
|
27
|
-
(uptime / 60) % 60,
|
28
|
-
uptime % 60)
|
25
|
+
uptime_str = format('%<hours>d hr %<minutes>02d min %<seconds>02d sec',
|
26
|
+
hours: uptime / 3600,
|
27
|
+
minutes: (uptime / 60) % 60,
|
28
|
+
seconds: uptime % 60)
|
29
29
|
ERB.new(STATUSZ_TMPL).result(binding)
|
30
30
|
end
|
31
31
|
end
|
@@ -34,7 +34,7 @@ SERVER_START = Time.now
|
|
34
34
|
|
35
35
|
# Does not include the following deprecated config params:
|
36
36
|
# auth_method, private_key_email, private_key_passphrase, private_key_path
|
37
|
-
CONFIG_KEYS = %w
|
37
|
+
CONFIG_KEYS = %w[
|
38
38
|
adjust_invalid_timestamps
|
39
39
|
autoformat_stackdriver_trace
|
40
40
|
coerce_to_utf8
|
@@ -68,9 +68,8 @@ CONFIG_KEYS = %w(
|
|
68
68
|
vm_id
|
69
69
|
vm_name
|
70
70
|
zone
|
71
|
-
|
71
|
+
].freeze
|
72
72
|
|
73
|
-
# rubocop:disable LineLength
|
74
73
|
STATUSZ_TMPL = %(\
|
75
74
|
<!DOCTYPE html>
|
76
75
|
<html>
|
@@ -121,4 +120,3 @@ STATUSZ_TMPL = %(\
|
|
121
120
|
</body>
|
122
121
|
</html>
|
123
122
|
).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
|