about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2017-03-23aggregate/pmq: update version numbers for Ruby and Linux
Linux is in the 4.x and Ruby is into the 2.x range, by now, so try to get with the times.
2017-03-18aggregate/pmq: avoid File#stat allocation aggregate-pmq
File#size is available in modern Rubies so the extra syscall is avoided.
2017-03-18aggregate/pmq: remove io-extra requirement
IO.copy_stream is standard in 1.9+ and can use pread when given an offset. We do not need to use pwrite with fcntl locking, actually.
2017-03-18aggregate/pmq: avoid false sharing of lock buffers
And rely on frozen string optimizations in Ruby while we're at it.
2016-07-29use HTTPS and move homepage to https://bogomips.org/raindrops/
While raindrops.bogomips.org exists, having extra subjectAltName entries is bloating the certificate. This will make it easier to mirror the homepage on Tor hidden services.
2016-07-27drop Rack::Utils.bytesize dependency
rack 2.0 removes this method, but we actually don't need it since any strings we generate are binary and Aggregate#to_s output is 7-bit clean.
2016-02-24middleware: minor bytecode size reduction
The "defineclass" VM instruction takes more operands and uses more space than "setconstant". Since we have no methods or subclasses/constants to define under the "Raindrops::Middleware::Stats" class,
2016-02-23linux: remove Pathname stdlib dependency
The File.readlink has been available since the earliest SVN import of Ruby from Jan 16 1998. There's no reason to load the Pathname class here since we don't do any further pathname manipulation. So avoid loading the extra .so here and creating extra objects.
2016-02-23linux: workaround Ruby 2.3 change
File.readlink (and thus Pathname#realpath) returns the filesystem encoding (Encoding.find "filesystem"). The filesystem encoding defaults to the locale encoding, which tends to be UTF-8. This is true even on *nix filesystems which can have any byte besides "\0". ref: https://bugs.ruby-lang.org/issues/12034 ref: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/73593
2016-02-02remove optimizations which made sense for older rubies
Since Ruby 2.2, frozen string literals are implied for Hash#[] lookups. Constant lookups have inline caching since Ruby 1.9 (from YARV).
2015-01-13move mailing list to raindrops-public@bogomips.org
Existing subscribers on librelist will need to resubscribe since there's no published subscriber lists anywhere. The public-inbox + mlmmj setup on bogomips.org allows posting without subscription and offers downloadable archives via git. The lack of rsyncable archives on librelist nowadays and subscription-required nature of librelist are points against it. Repliers should Cc: all recipients (using the reply-all function of their mail client) since many readers are not subscribed. This project has never accepted or encouraged HTML email, but librelist accepted it. The bogomips.org mail server is configured to treat HTML mail as spam, so do not send HTML mail if you expect a response. Users who wish to subscribe may send a message to: raindrops-public+subscribe@bogomips.org Similarly, they may unsubscribe via: raindrops-public+unsubscribe@bogomips.org HTTP archives are available via: http://bogomips.org/raindrops-public/ ssoma users may also use: git://bogomips.org/raindrops-public (see README change) Old messages to the librelist addresses will continue to get routed to the new mailing list. ref: http://public-inbox.org/
2013-11-05last_data_recv: do not assume Unicorn includes all constants
Some projects may load parts of Unicorn and not others.
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 :)