about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2013-04-11watcher: set Content-Type via assignment
Relying on String#replace to set Content-Type stopped working with rack commit 3623d04526b953a63bfb3e72de2d6920a042563f This fixes compatibility with the Rack 1.5.x series.
2012-11-30Watcher: Use relative paths in HTML links
When I mount Raindrops::Watcher like so: map "/_raindrops" do run Raindrops::Watcher.new end Then in the HTML output links use an absolute path instead of relative to the path /_raindrops/ Cheers, Lawrence Signed-off-by: Eric Wong <normalperson@yhbt.net>
2012-06-18watcher: do not require Rack::Head for HEAD response
Rack webservers are not guaranteed to include Rack::Head in the middleware stack. Watcher is a standalone app, so it cannot rely on a framework which automatically includes Rack::Head.
2012-06-18watcher: sort index of listener listing
For hosts with many listeners, it should be easier to read the index page if the results are shown in a consistent order. Requested privately via email to raindrops@bogomips.org
2012-06-12unix: show zero-value stats for idle listeners
When unix_listener_stats is called without arguments, it should still match the behavior of tcp_listener_stats and return ListenerStats object with zero values. This allows callers to iterate through the results to find the pathnames of all the Unix domain sockets in in listen mode.
2012-06-07middleware/proxy: favor __send__ for method dispatch
"send" is more likely to be overridden in subclasses whereas the Ruby runtime (at least 1.9.3) will warn loudly if any user code (re)defines the "__send__" method. For example, BasicSocket#send and UDPSocket#send in the Ruby stdlib are wrappers for the send(2)/sendto(2) system calls, and it's entirely possible an application could return a Socket-subclass as a Rack response body.
2012-06-05unix_listener_stats follows and remembers symlinks
Teach unix_listener_stats to remember the symlink path it followed and have it point to the same object as the resolved (real) socket path. This allows the case where looking up stats by symlinks works if the symlink is given to unix_listener_stats: File.symlink("/real/path/of.sock", "/path/to/link.sock") stats = unix_listener_stats(["/path/to/link.sock"]) stats["/path/to/link.sock"] => # same as stats["/real/path/of.sock"]
2012-06-05resolve symlinks to Unix domain sockets
Raindrops currently fails when provided a symlink to a socket. As this is a common practice for many deployment tools (Vlad, etc.) this patch adds support for finding the realpath prior to looking the socket up in /proc/net/unix [ew: commit message subject] [ew: fixed test to pass under 1.9.3 and 1.8.7: * Tempfile#unlink is unsafe to call if we want to reuse the path, use File.unlink(tmp.path) instead * The return value of File.symlink is zero (or it raises), so it's unusable. * File.symlink will not call #to_path under 1.8.7, so it's necessary to pass pathnames to it, not Tempfile objects. ] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2012-05-21middleware/proxy: fixup comment/whitespace
Noted, but not fixed in the previous commit commit abc6dd47ede5b96ada1ff8f37dfba73cd5fd586a (Add method_missing to Raindrops::Middleware::Proxy)
2012-05-18Add method_missing to Raindrops::Middleware::Proxy
This enables it to behave more like a Rack BodyProxy would, delegating methods to its body object when it does not implement them itself. (Also includes a minor grammar fix to a comment.) [ew: minor comment/whitespace fix] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2012-01-07avoid calling tcp_listener_stats when it is not available
Signed-off-by: Aman Gupta <aman@tmm1.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2012-01-07fix ListenStats documentation error in Raindrops::Linux.unix_listener_stats
Signed-off-by: Aman Gupta <aman@tmm1.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2011-10-141.8 compatibility workarounds
Math.sqrt on 1.8.7 does not give NaN for certain errors. We'll also fix our Errno::EDOM retry loop to avoid resetting the "retried" flag.
2011-10-12avoid inadvertant object creation with invalid addresses
Just in case somebody tries to scan all addresses, we won't run out of memory as easily.
2011-10-03watcher: document new headers for users
These names are not finalized, yet.
2011-10-03watcher: add peak times for statistics
It could be useful to know when the first and last peak time of a maximum was.
2011-09-27watcher: add X-Current header to headers
It can be useful to some to see that info all at once without hitting the HTML index page.
2011-08-01watcher: add POST /reset/$LISTENER endpoint rdoc
This was always supported via the HTML (browser) interface but there was no documented way of hitting it without a browser, before.
2011-06-27doc: librelist.com => librelist.org
A non-profit TLD makes more sense for a Free Software project.
2011-06-27fix Ruby warnings
Found in the check-warnings target in pkg.mk
2011-03-25last_data_recv: fixup rdoc
formatting is hard :<
2011-03-24watcher: fix documentation for X-* headers
I copied and pasted off the Raindrops::LastDataRecv documentation. While the headers and mathematical meanings are identical, they measure different things (but for the same purpose) Noticed-by: Troex Nevelin
2011-03-21watcher: remove redundant Rack::Response
No need to duplicate code
2011-03-18watcher: add title attributes to elements
It can help navigation, we think...
2011-03-18watcher: RDoc examples point to the demo
No need to waste bandwidth of example.com when we have a meaningful demo site :)
2011-03-18watcher: set Expires headers for cache invalidation
We know exactly when to invalidate based on the delay :)
2011-03-18watcher: prevent Rack::Deflater from buffering
Set "Cache-Control: no-transform" to prevent frontend proxies from flushing data.
2011-03-17watcher: add link to the Watcher documentation
Hopefully people can learn to use the REST API this way.
2011-03-16watcher: fix rdoc
2011-03-16watcher: retry on empty stats
Those will cause Aggregate to raise Errno::EDOM
2011-03-17rdoc: document the demo URLs
2011-03-17watcher: properly stream responses for <= HTTP/1.0
nginx makes HTTP/1.0 requests and expects HTTP/1.1 responses
2011-03-16add Watcher Rack application
It does streaming!
2011-03-14linux: avoid Array#first/Array#last
More confusing for me, actually...
2011-03-14linux: unix_listener_stats may scan all paths
This matches behavior of the TCP version.
2011-03-11doc: more rdoc updates for Linux users
Yes we love Linux more than other systems :>
2011-03-11the core Raindrops class is portable, yes it is
OK, not to non-Unix but I'll never care :>
2011-03-10rdoc: 100% documentation coverage!
Of course, RDoc doesn't know quantity vs quality :)
2011-03-09aggregate/pmq: we need a Mutex to protect fcntl() locks
fcntl() locks are per-process, so we also need something to protect individual threads within a process from stepping over each other.
2011-03-08preliminary Rack app to track last_data_recv
Seems to basically work
2011-03-04Aggregate support via POSIX message queues
2011-02-28doc: mention tcp_diag/inet_diag for old kernels
People actually need to load modules manually on older kernels :<
2011-02-26middleware: split out proxy class
It's easier to find this way.
2011-02-26middleware: avoid double decrement when reading stats
Oops!
2011-02-25proxy +to_path+ calls in the response body
We need to do this for apps that depend on things like the sendfile() optimizations in Rainbows!
2011-02-23use autoload for Linux module
We'll be doing more Linux-only stuff
2011-02-15middleware: add ipv6 address detection for Unicorn
Since Unicorn and Rainbows! support IPv6 now, it makes sense to support the rfc2732-style addresses it returns.
2011-02-15middleware: switch to ivars
These are slightly faster than regular method dispatch
2011-02-15middleware: avoid capturing block variable
It's a needless allocation
2011-02-15unindent modules
No need to clutter/confuse namespace lookups