1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-08-02 22:28:24 +00:00

Merge pull request #321 from tomav/fixed_display_order

Fixed display order
This commit is contained in:
Kenyon Ralph 2013-07-07 17:48:00 -07:00
commit 0842719a72
3 changed files with 8 additions and 8 deletions

View file

@ -61,7 +61,7 @@ module Munin
# fetch all pids that match thin # fetch all pids that match thin
def get_pids def get_pids
pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}'`.split(/\r?\n/) pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}' | sort -t'|' -nk 2`.split(/\r?\n/)
end end
def autoconf def autoconf
@ -81,7 +81,7 @@ when "config"
puts "graph_args --base 1024 -l 0" puts "graph_args --base 1024 -l 0"
puts "graph_scale yes" puts "graph_scale yes"
puts "graph_info Tracks the size of individual thin processes" puts "graph_info Tracks the size of individual thin processes"
mpm.get_pids.sort.each do |instance| mpm.get_pids.each do |instance|
pid, port = instance.split("|") pid, port = instance.split("|")
puts "thin_#{port}.label thin_#{port}" puts "thin_#{port}.label thin_#{port}"
puts "thin_#{port}.info Process memory" puts "thin_#{port}.info Process memory"

View file

@ -44,7 +44,7 @@ module Munin
instances = get_pids() instances = get_pids()
instances.each do |instance| instances.each do |instance|
pid, port = instance.split("|") pid, port = instance.split("|")
rss = (get_threads(pid).to_i)/1024 rss = (get_threads(pid).to_i)
puts "thin_#{port}.value #{rss}" puts "thin_#{port}.value #{rss}"
end end
end end
@ -55,7 +55,7 @@ module Munin
# TODO: make this work on OSX and Solaris, # TODO: make this work on OSX and Solaris,
# so the whole unix gang is happy ;) # so the whole unix gang is happy ;)
def get_threads(pid) def get_threads(pid)
res = `grep "Threads" /proc/#{pid}/status`.split[1] res = `grep "Threads" /proc/#{pid}/status | cut -d ":" -f2`.gsub(/\s+/, "")
if res.match("cannot access") if res.match("cannot access")
return nil return nil
else else
@ -65,7 +65,7 @@ module Munin
# fetch all pids that match thin # fetch all pids that match thin
def get_pids def get_pids
pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}'`.split(/\r?\n/) pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}' | sort -t'|' -nk 2`.split(/\r?\n/)
end end
def autoconf def autoconf
@ -85,7 +85,7 @@ when "config"
puts "graph_args -l 0" puts "graph_args -l 0"
puts "graph_scale yes" puts "graph_scale yes"
puts "graph_info Tracks how many threads per thin processes" puts "graph_info Tracks how many threads per thin processes"
mpm.get_pids.sort.each do |instance| mpm.get_pids.each do |instance|
pid, port = instance.split("|") pid, port = instance.split("|")
puts "thin_#{port}.label thin_#{port}" puts "thin_#{port}.label thin_#{port}"
puts "thin_#{port}.info Threads per Thin process" puts "thin_#{port}.info Threads per Thin process"

View file

@ -63,7 +63,7 @@ module Munin
# fetch all pids that match thin # fetch all pids that match thin
def get_pids def get_pids
pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}'`.split(/\r?\n/) pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}' | sort -t'|' -nk 2`.split(/\r?\n/)
end end
def autoconf def autoconf
@ -83,7 +83,7 @@ when "config"
puts "graph_args -l 0" puts "graph_args -l 0"
puts "graph_scale yes" puts "graph_scale yes"
puts "graph_info Tracks the peak memory of thin processes, aka High Water Mark." puts "graph_info Tracks the peak memory of thin processes, aka High Water Mark."
mpm.get_pids.sort.each do |instance| mpm.get_pids.each do |instance|
pid, port = instance.split("|") pid, port = instance.split("|")
puts "thin_#{port}.label thin_#{port}" puts "thin_#{port}.label thin_#{port}"
puts "thin_#{port}.info Peak Memory" puts "thin_#{port}.info Peak Memory"