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
|
# reports how long the puppet agent took to apply the catalog
|
||||||
def get_runtime
|
def get_runtime
|
||||||
logfile = ENV['puppet_logfile'] || '/var/log/messages'
|
logfile = ENV["puppet_logfile"] || "/var/log/messages"
|
||||||
t = Time.now
|
t = Time.now
|
||||||
dateformat = ENV['puppet_logformat'] || "^%b %d"
|
dateformat = ENV["puppet_logformat"] || "^%b %d"
|
||||||
today = t.strftime(dateformat)
|
today = t.strftime(dateformat)
|
||||||
File.open(logfile).grep(/#{today}/).grep(/Finished catalog run in/).reverse_each do |line|
|
File.open(logfile).grep(/#{today}/).grep(/Finished catalog run in/).reverse_each do |line|
|
||||||
if line =~ /in (.*) seconds/
|
if line =~ /in (.*) seconds/
|
||||||
|
@ -28,18 +28,17 @@ def get_runtime
|
||||||
end
|
end
|
||||||
|
|
||||||
case ARGV[0]
|
case ARGV[0]
|
||||||
when 'config'
|
when "config"
|
||||||
puts "graph_category other"
|
puts "graph_category other"
|
||||||
puts "graph_args --base 1000 -l 0"
|
puts "graph_args --base 1000 -l 0"
|
||||||
puts "graph_scale no"
|
puts "graph_scale no"
|
||||||
puts "graph_title puppet catalog run time"
|
puts "graph_title puppet catalog run time"
|
||||||
puts "graph_vlabel Seconds"
|
puts "graph_vlabel Seconds"
|
||||||
puts "runtime.label Catalog application time"
|
puts "runtime.label Catalog application time"
|
||||||
exit 0
|
exit 0
|
||||||
when 'autoconf'
|
when "autoconf"
|
||||||
puts "yes"
|
puts "yes"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
get_runtime
|
get_runtime
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue