diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-03-11 13:49:08 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-03-11 13:49:08 -0800 |
commit | 55c9127ede4114f65b0bc01cdaa1152ef21ca95a (patch) | |
tree | 5683095ed447c0bc81551ccfff2a344e4ab978d5 /lib | |
parent | 57fe99f294e0fe948593beeae7cf879efe4cdd52 (diff) | |
download | raindrops-55c9127ede4114f65b0bc01cdaa1152ef21ca95a.tar.gz |
Yes we love Linux more than other systems :>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/raindrops/aggregate/last_data_recv.rb | 10 | ||||
-rw-r--r-- | lib/raindrops/linux.rb | 7 |
2 files changed, 14 insertions, 3 deletions
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 |