avoid calling tcp_listener_stats when it is not available
authorAman Gupta <aman@tmm1.net>
Sat, 7 Jan 2012 07:48:41 +0000 (6 23:48 -0800)
committerEric Wong <normalperson@yhbt.net>
Sat, 7 Jan 2012 08:01:57 +0000 (7 08:01 +0000)
Signed-off-by: Aman Gupta <aman@tmm1.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
lib/raindrops/middleware.rb

index a411de7..7c647ec 100644 (file)
@@ -130,7 +130,7 @@ class Raindrops::Middleware
     body = "calling: #{@stats.calling}\n" \
            "writing: #{@stats.writing}\n"
 
-    if defined?(Raindrops::Linux)
+    if defined?(Raindrops::Linux.tcp_listener_stats)
       Raindrops::Linux.tcp_listener_stats(@tcp).each do |addr,stats|
         body << "#{addr} active: #{stats.active}\n" \
                 "#{addr} queued: #{stats.queued}\n"