|author||Eric Wong <firstname.lastname@example.org>||2011-03-11 13:49:08 -0800|
|committer||Eric Wong <email@example.com>||2011-03-11 13:49:08 -0800|
Yes we love Linux more than other systems :>
3 files changed, 17 insertions, 3 deletions
@@ -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
@@ -1,8 +1,11 @@
# -*- encoding: binary -*-
# 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
# 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.
@@default_aggregate = nil
# By default, this is a Raindrops::Aggregate::PMQ object
+ # It may be anything that responds to *<<*
@@default_aggregate ||= Raindrops::Aggregate::PMQ.new
- # assign any object that is duck-type compatible with \Aggregate here,
+ # Assign any object that responds to *<<*
@@default_aggregate = agg
diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
index 630bfe2..889c661 100644
@@ -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
# The standard proc path for active UNIX domain sockets, feel free to call