lib/fluent/plugin/statusz.rb in fluent-plugin-google-cloud-0.12.11 vs lib/fluent/plugin/statusz.rb in fluent-plugin-google-cloud-0.13.0
- old
+ new
@@ -17,17 +17,19 @@
# Module for collecting diagnostic information and formatting it as an
# HTML page to serve on the /statusz endpoint.
module Statusz
module_function
- # NOTE: The plugin parameter is referenced in STATUSZ_TMPL.
def response(plugin)
uptime = Time.now - SERVER_START
uptime_str = format('%<hours>d hr %<minutes>02d min %<seconds>02d sec',
hours: uptime / 3600,
minutes: (uptime / 60) % 60,
seconds: uptime % 60)
- ERB.new(STATUSZ_TMPL).result(binding)
+ ERB.new(STATUSZ_TMPL).result_with_hash(
+ plugin: plugin,
+ uptime_str: uptime_str
+ )
end
end
SERVER_START = Time.now