raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] raindrops 0.17.0 - real-time stats for preforking Rack servers
@ 2016-07-31 15:26  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-07-31 15:26 UTC (permalink / raw)
  To: ruby-talk, raindrops-public

raindrops is a real-time stats toolkit to show statistics for Rack HTTP
servers.  It is designed for preforking servers such as unicorn, but
should support any Rack HTTP server on platforms supporting POSIX shared
memory.  It may also be used as a generic scoreboard for sharing atomic
counters across multiple processes.

* https://bogomips.org/raindrops/
* No subscription necessary, no HTML mail:
  raindrops-public@bogomips.org
* mail archives: https://bogomips.org/raindrops-public/
  http://ou63pmih66umazou.onion/raindrops-public/
  nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
  nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.raindrops
* git clone git://bogomips.org/raindrops.git
* https://bogomips.org/raindrops/NEWS.atom.xml
* Demo site: https://raindrops-demo.bogomips.org:8443/

Changes:

raindrops 0.17.0 - rack 2.x updates

This release features minor updates to support rack 2.x
while maintaining support for rack 1.2 and later.
As a result, Ruby 1.8.6 compatibility is gone, but
Ruby 1.8.7 probably still works, for now.

There's also a minor warning fix, doc updates, and
the homepage now supports HTTPS (HTTP remains supported)

5 changes since raindrops 0.16.0:
      drop Rack::Utils.bytesize dependency
      gemspec: bump Rack dependency
      linux_inet_diag: GCC attribute format check
      use HTTPS and move homepage to https://bogomips.org/raindrops/
      examples: add yahns config, zbatery is abandoned

^ permalink raw reply	[relevance 7%]

* [PATCH] drop Rack::Utils.bytesize dependency
@ 2016-07-27 22:51  6% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-07-27 22:51 UTC (permalink / raw)
  To: raindrops-public

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.
---
 lib/raindrops/watcher.rb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/raindrops/watcher.rb b/lib/raindrops/watcher.rb
index fb2df5b..f0abd1d 100644
--- a/lib/raindrops/watcher.rb
+++ b/lib/raindrops/watcher.rb
@@ -244,10 +244,10 @@ def agg_to_hash(reset_at, agg, current, peak)
   def histogram_txt(agg)
     updated_at, reset_at, agg, current, peak = *agg
     headers = agg_to_hash(reset_at, agg, current, peak)
-    body = agg.to_s
+    body = agg.to_s # 7-bit ASCII-clean
     headers["Content-Type"] = "text/plain"
     headers["Expires"] = (updated_at + @delay).httpdate
-    headers["Content-Length"] = bytesize(body).to_s
+    headers["Content-Length"] = body.size.to_s
     [ 200, headers, [ body ] ]
   end
 
@@ -265,7 +265,7 @@ def histogram_html(agg, addr)
       "</body>"
     headers["Content-Type"] = "text/html"
     headers["Expires"] = (updated_at + @delay).httpdate
-    headers["Content-Length"] = bytesize(body).to_s
+    headers["Content-Length"] = body.size.to_s
     [ 200, headers, [ body ] ]
   end
 
@@ -364,7 +364,7 @@ def index
         "for more information and options." \
       "</p>" \
       "</body></html>"
-    headers["Content-Length"] = bytesize(body).to_s
+    headers["Content-Length"] = body.size.to_s
     [ 200, headers, [ body ] ]
   end
 
@@ -382,7 +382,7 @@ def initialize(rdmon, addr, env) # :nodoc:
       q = Rack::Utils.parse_query env["QUERY_STRING"]
       @active_min = q["active_min"].to_i
       @queued_min = q["queued_min"].to_i
-      len = Rack::Utils.bytesize(addr)
+      len = addr.size
       len = 35 if len > 35
       @fmt = "%20s % #{len}s % 10u % 10u\n"
       case env["HTTP_VERSION"]
-- 
EW


^ permalink raw reply related	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-07-27 22:51  6% [PATCH] drop Rack::Utils.bytesize dependency Eric Wong
2016-07-31 15:26  7% [ANN] raindrops 0.17.0 - real-time stats for preforking Rack servers Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/raindrops.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).