mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
plugins/puppet/puppet_runtime: fix formatting
Used rufo https://github.com/ruby-formatter/rufo
This commit is contained in:
parent
852aa41ab7
commit
6052c56d94
1 changed files with 15 additions and 16 deletions
|
@ -15,9 +15,9 @@
|
|||
|
||||
# reports how long the puppet agent took to apply the catalog
|
||||
def get_runtime
|
||||
logfile = ENV['puppet_logfile'] || '/var/log/messages'
|
||||
logfile = ENV["puppet_logfile"] || "/var/log/messages"
|
||||
t = Time.now
|
||||
dateformat = ENV['puppet_logformat'] || "^%b %d"
|
||||
dateformat = ENV["puppet_logformat"] || "^%b %d"
|
||||
today = t.strftime(dateformat)
|
||||
File.open(logfile).grep(/#{today}/).grep(/Finished catalog run in/).reverse_each do |line|
|
||||
if line =~ /in (.*) seconds/
|
||||
|
@ -28,7 +28,7 @@ def get_runtime
|
|||
end
|
||||
|
||||
case ARGV[0]
|
||||
when 'config'
|
||||
when "config"
|
||||
puts "graph_category other"
|
||||
puts "graph_args --base 1000 -l 0"
|
||||
puts "graph_scale no"
|
||||
|
@ -36,10 +36,9 @@ case ARGV[0]
|
|||
puts "graph_vlabel Seconds"
|
||||
puts "runtime.label Catalog application time"
|
||||
exit 0
|
||||
when 'autoconf'
|
||||
when "autoconf"
|
||||
puts "yes"
|
||||
exit 0
|
||||
else
|
||||
else
|
||||
get_runtime
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue