Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Memory statistics tool: warn if not on Linux.

  • Loading branch information...
commit 2cbd4debcb83c562a454e239a9b65ad3c19e2bba 1 parent 81a4850
@FooBarWidget FooBarWidget authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/passenger-memory-stats
View
6 bin/passenger-memory-stats
@@ -93,7 +93,11 @@ class MemoryStats
passenger_processes = list_processes(:match => /(^Passenger |^Rails:|ApplicationPoolServerExecutable)/)
print_process_list("Passenger processes", passenger_processes, :show_ppid => false)
- if ::Process.uid != 0 && (apache_processes + passenger_processes).any?{ |p| p.private_dirty_rss.nil? }
+ if RUBY_PLATFORM !~ /linux/
+ puts
+ puts "*** WARNING: The private dirty RSS can only be displayed " <<
+ "on Linux. You're currently using '#{RUBY_PLATFORM}'."
+ elsif ::Process.uid != 0 && (apache_processes + passenger_processes).any?{ |p| p.private_dirty_rss.nil? }
puts
puts "*** WARNING: Please run this tool as root. Otherwise the " <<
"private dirty RSS of processes cannot be determined."
Please sign in to comment.
Something went wrong with that request. Please try again.