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.16.0 - real-time stats for preforking Rack servers
@ 2016-02-29 12:42  5% Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2016-02-29 12:42 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.

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

Changes:

    raindrops 0.16.0 - minor fixes and workarounds
    
    There's mainly a fix/workaround for Ruby 2.3 now returning
    locale-aware strings for File.readlink and our test suite
    using strange paths allowed by *nix.
    
    	https://bugs.ruby-lang.org/issues/12034
    
    tcp_listener_stats won't return "true" object placeholders
    if stats are configured for a non-existent listener.
    
    There are also minor optimizations for Ruby 2.2+ (at the expense
    of 2.1 and earlier).
    
    And the usual round of minor tweaks and doc updates.
    
    10 changes since v0.15.0:
          gemspec: avoid circular dependency on unicorn
          remove optimizations which made sense for older rubies
          linux: workaround Ruby 2.3 change
          linux: remove Pathname stdlib dependency
          add .gitattributes for Ruby method detection
          middleware: minor bytecode size reduction
          doc: update URLs and references
          README: remove indentation from URLs in RDoc
          linux: tcp_listener_stats drops "true" placeholders
          build: use '--local' domain for dev gem install

^ permalink raw reply	[relevance 5%]

* Re: [RFC 2/1] linux: remove Pathname stdlib dependency
  2016-02-23  2:04  4% ` [RFC 2/1] linux: remove Pathname stdlib dependency Eric Wong
@ 2016-02-23 11:00  0%   ` Antonio Terceiro
  0 siblings, 0 replies; 4+ results
From: Antonio Terceiro @ 2016-02-23 11:00 UTC (permalink / raw)
  To: Eric Wong; +Cc: raindrops-public

[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

On Tue, Feb 23, 2016 at 02:04:34AM +0000, Eric Wong wrote:
> 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.
> ---
>  Noticed while reviewing "[RFC] linux: workaround Ruby 2.3 change"
>  http://bogomips.org/raindrops-public/20160202183136.21549-1-e@80x24.org/raw
> 
>  lib/raindrops/linux.rb | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
> index a38fa64..4166ec7 100644
> --- a/lib/raindrops/linux.rb
> +++ b/lib/raindrops/linux.rb
> @@ -8,7 +8,6 @@
>  # 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
> -require 'pathname'
>  
>  module Raindrops::Linux
>  
> @@ -46,7 +45,7 @@ module Raindrops::Linux
>          path.force_encoding(Encoding::BINARY) if defined?(Encoding)
>          if File.symlink?(path)
>            link = path
> -          path = Pathname.new(link).realpath.to_s
> +          path = File.readlink(link)
>            path.force_encoding(Encoding::BINARY) if defined?(Encoding)
>            rv[link] = rv[path] # vivify ListenerStats
>          else
> -- 
> EW

LGTM


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 820 bytes --]

^ permalink raw reply	[relevance 0%]

* [RFC 2/1] linux: remove Pathname stdlib dependency
  2016-02-02 18:31  7% [RFC] linux: workaround Ruby 2.3 change Eric Wong
@ 2016-02-23  2:04  4% ` Eric Wong
  2016-02-23 11:00  0%   ` Antonio Terceiro
  0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2016-02-23  2:04 UTC (permalink / raw)
  To: raindrops-public; +Cc: Antonio Terceiro

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.
---
 Noticed while reviewing "[RFC] linux: workaround Ruby 2.3 change"
 http://bogomips.org/raindrops-public/20160202183136.21549-1-e@80x24.org/raw

 lib/raindrops/linux.rb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
index a38fa64..4166ec7 100644
--- a/lib/raindrops/linux.rb
+++ b/lib/raindrops/linux.rb
@@ -8,7 +8,6 @@
 # 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
-require 'pathname'
 
 module Raindrops::Linux
 
@@ -46,7 +45,7 @@ module Raindrops::Linux
         path.force_encoding(Encoding::BINARY) if defined?(Encoding)
         if File.symlink?(path)
           link = path
-          path = Pathname.new(link).realpath.to_s
+          path = File.readlink(link)
           path.force_encoding(Encoding::BINARY) if defined?(Encoding)
           rv[link] = rv[path] # vivify ListenerStats
         else
-- 
EW

^ permalink raw reply related	[relevance 4%]

* [RFC] linux: workaround Ruby 2.3 change
@ 2016-02-02 18:31  7% Eric Wong
  2016-02-23  2:04  4% ` [RFC 2/1] linux: remove Pathname stdlib dependency Eric Wong
  0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2016-02-02 18:31 UTC (permalink / raw)
  To: raindrops-public

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
---
 lib/raindrops/linux.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
index 7cfb653..a38fa64 100644
--- a/lib/raindrops/linux.rb
+++ b/lib/raindrops/linux.rb
@@ -47,6 +47,7 @@ module Raindrops::Linux
         if File.symlink?(path)
           link = path
           path = Pathname.new(link).realpath.to_s
+          path.force_encoding(Encoding::BINARY) if defined?(Encoding)
           rv[link] = rv[path] # vivify ListenerStats
         else
           rv[path] # vivify ListenerStats
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-02-02 18:31  7% [RFC] linux: workaround Ruby 2.3 change Eric Wong
2016-02-23  2:04  4% ` [RFC 2/1] linux: remove Pathname stdlib dependency Eric Wong
2016-02-23 11:00  0%   ` Antonio Terceiro
2016-02-29 12:42  5% [ANN] raindrops 0.16.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).