about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-11 13:49:08 -0800
committerEric Wong <normalperson@yhbt.net>2011-03-11 13:49:08 -0800
commit55c9127ede4114f65b0bc01cdaa1152ef21ca95a (patch)
tree5683095ed447c0bc81551ccfff2a344e4ab978d5
parent57fe99f294e0fe948593beeae7cf879efe4cdd52 (diff)
downloadraindrops-55c9127ede4114f65b0bc01cdaa1152ef21ca95a.tar.gz
Yes we love Linux more than other systems :>
-rw-r--r--README3
-rw-r--r--lib/raindrops/aggregate/last_data_recv.rb10
-rw-r--r--lib/raindrops/linux.rb7
3 files changed, 17 insertions, 3 deletions
diff --git a/README b/README
index 074722f..b5417ad 100644
--- a/README
+++ b/README
@@ -30,6 +30,9 @@ processes.
   instead of parsing /proc/net/tcp to minimize overhead.
   This was fun to discover and write.
 
+* TCP_Info reporting may be used to check stat for every accepted client
+  on TCP servers
+
 Users of older Linux kernels need to ensure that the the "inet_diag"
 and "tcp_diag" kernel modules are loaded as they do not autoload correctly
 
diff --git a/lib/raindrops/aggregate/last_data_recv.rb b/lib/raindrops/aggregate/last_data_recv.rb
index 87cbfb9..1e18d76 100644
--- a/lib/raindrops/aggregate/last_data_recv.rb
+++ b/lib/raindrops/aggregate/last_data_recv.rb
@@ -1,8 +1,11 @@
 # -*- encoding: binary -*-
 require "socket"
 #
+#
 # This module is used to extend TCPServer and Kgio::TCPServer objects
-# and aggregate +last_data_recv+ times for all accepted clients.
+# and aggregate +last_data_recv+ times for all accepted clients. It
+# is designed to be used with Raindrops::LastDataRecv Rack application
+# but can be easily changed to work with other stats collection devices.
 #
 # Methods wrapped include:
 # - TCPServer#accept
@@ -15,16 +18,19 @@ module Raindrops::Aggregate::LastDataRecv
   # :startdoc:
 
   # The integer value of +last_data_recv+ is sent to this object.
+  # This is usually a duck type compatible with the \Aggregate class,
+  # but can be *anything* that accepts the *<<* method.
   attr_accessor :raindrops_aggregate
 
   @@default_aggregate = nil
 
   # By default, this is a Raindrops::Aggregate::PMQ object
+  # It may be anything that responds to *<<*
   def self.default_aggregate
     @@default_aggregate ||= Raindrops::Aggregate::PMQ.new
   end
 
-  # assign any object that is duck-type compatible with \Aggregate here,
+  # Assign any object that responds to *<<*
   def self.default_aggregate=(agg)
     @@default_aggregate = agg
   end
diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
index 630bfe2..889c661 100644
--- a/lib/raindrops/linux.rb
+++ b/lib/raindrops/linux.rb
@@ -2,7 +2,12 @@
 
 # For reporting TCP ListenStats, users of older \Linux kernels need to ensure
 # that the the "inet_diag" and "tcp_diag" kernel modules are loaded as they do
-# not autoload correctly
+# not autoload correctly.  The inet_diag facilities of \Raindrops is useful
+# for periodic snapshot reporting of listen queue sizes.
+#
+# Instead of snapshotting, Raindrops::Aggregate::LastDataRecv may be used
+# to aggregate statistics from +all+ accepted sockets as they arrive
+# based on the +last_data_recv+ field in Raindrops::TCP_Info
 module Raindrops::Linux
 
   # The standard proc path for active UNIX domain sockets, feel free to call