mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-01 05:43:44 +00:00
Merge pull request #321 from tomav/fixed_display_order
Fixed display order
This commit is contained in:
commit
0842719a72
3 changed files with 8 additions and 8 deletions
|
@ -61,7 +61,7 @@ module Munin
|
|||
|
||||
# fetch all pids that match thin
|
||||
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
|
||||
|
||||
def autoconf
|
||||
|
@ -81,7 +81,7 @@ when "config"
|
|||
puts "graph_args --base 1024 -l 0"
|
||||
puts "graph_scale yes"
|
||||
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("|")
|
||||
puts "thin_#{port}.label thin_#{port}"
|
||||
puts "thin_#{port}.info Process memory"
|
||||
|
|
|
@ -44,7 +44,7 @@ module Munin
|
|||
instances = get_pids()
|
||||
instances.each do |instance|
|
||||
pid, port = instance.split("|")
|
||||
rss = (get_threads(pid).to_i)/1024
|
||||
rss = (get_threads(pid).to_i)
|
||||
puts "thin_#{port}.value #{rss}"
|
||||
end
|
||||
end
|
||||
|
@ -55,7 +55,7 @@ module Munin
|
|||
# TODO: make this work on OSX and Solaris,
|
||||
# so the whole unix gang is happy ;)
|
||||
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")
|
||||
return nil
|
||||
else
|
||||
|
@ -65,7 +65,7 @@ module Munin
|
|||
|
||||
# fetch all pids that match thin
|
||||
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
|
||||
|
||||
def autoconf
|
||||
|
@ -85,7 +85,7 @@ when "config"
|
|||
puts "graph_args -l 0"
|
||||
puts "graph_scale yes"
|
||||
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("|")
|
||||
puts "thin_#{port}.label thin_#{port}"
|
||||
puts "thin_#{port}.info Threads per Thin process"
|
||||
|
|
|
@ -63,7 +63,7 @@ module Munin
|
|||
|
||||
# fetch all pids that match thin
|
||||
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
|
||||
|
||||
def autoconf
|
||||
|
@ -83,7 +83,7 @@ when "config"
|
|||
puts "graph_args -l 0"
|
||||
puts "graph_scale yes"
|
||||
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("|")
|
||||
puts "thin_#{port}.label thin_#{port}"
|
||||
puts "thin_#{port}.info Peak Memory"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue