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.18.0 - real-time stats for preforking Rack servers
@ 2017-03-23  2:48  5% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2017-03-23  2:48 UTC (permalink / raw)
  To: ruby-talk, raindrops-public; +Cc: unicorn-public, Simon Eskildsen, Jeremy Evans

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.18.0
    
    The most notable feature of this release is the addition of
    FreeBSD and OpenBSD TCP_INFO support.  This includes the
    Raindrops::TCP for portably mapping TCP state names to
    platform-dependent numeric values:
    
      https://bogomips.org/raindrops/Raindrops.html#TCP
    
    Thanks to Jeremy Evans and Simon Eskildsen on the
    unicorn-public@bogomips.org mailing list for inspiring
    these changes to raindrops.
    
    There's also a few internal cleanups, and documentation
    improvements, including some fixes to the largely-forgotten
    Raindrops::Aggreage::PMQ class:
    
      https://bogomips.org/raindrops/Raindrops/Aggregate/PMQ.html
    
    20 changes since 0.17.0:
    
          test_inet_diag_socket: fix Fixnum deprecation warning
          TODO: add item for IPv6 breakage
          ext: fix documentation for C ext-defined classes
          TCP_Info: custom documentation for #get!
          TypedData C-API conversion
          test_watcher: disable test correctly when aggregate is missing
          tcp_info: support this struct under FreeBSD
          define Raindrops::TCP hash for TCP states
          linux_inet_diag: reduce stack usage and simplify
          avoid reading errno repeatedly
          aggregate/pmq: avoid false sharing of lock buffers
          aggregate/pmq: remove io-extra requirement
          aggregate/pmq: avoid File#stat allocation
          Merge remote-tracking branch 'origin/freebsd'
          Merge remote-tracking branch 'origin/aggregate-pmq'
          doc: remove private email support address
          doc: update location of TCP_INFO-related stuff
          build: avoid olddoc for building the RubyGem
          doc: document Raindrops::TCP hash
          aggregate/pmq: update version numbers for Ruby and Linux

^ permalink raw reply	[relevance 5%]

* [PATCH 0/3] aggregate/pmq: various fixes and cleanups
@ 2017-03-16  3:14  7% Eric Wong
  2017-03-16  3:14  6% ` [PATCH 2/3] aggregate/pmq: remove io-extra requirement Eric Wong
  0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2017-03-16  3:14 UTC (permalink / raw)
  To: raindrops-public

Now that we rely on Ruby 1.9+, we can rely on IO.copy_stream
and remove the io-extra requirement.  Future Rubies may even
have pread/pwrite support natively.

Eric Wong (3):
      aggregate/pmq: avoid false sharing of lock buffers
      aggregate/pmq: remove io-extra requirement
      aggregate/pmq: avoid File#stat allocation

 lib/raindrops/aggregate/pmq.rb | 22 ++++++++++++++--------
 raindrops.gemspec              |  1 -
 2 files changed, 14 insertions(+), 9 deletions(-)


^ permalink raw reply	[relevance 7%]

* [PATCH 2/3] aggregate/pmq: remove io-extra requirement
  2017-03-16  3:14  7% [PATCH 0/3] aggregate/pmq: various fixes and cleanups Eric Wong
@ 2017-03-16  3:14  6% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2017-03-16  3:14 UTC (permalink / raw)
  To: raindrops-public

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.
---
 lib/raindrops/aggregate/pmq.rb | 12 ++++++++----
 raindrops.gemspec              |  1 -
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/raindrops/aggregate/pmq.rb b/lib/raindrops/aggregate/pmq.rb
index f543302..5a6a1f6 100644
--- a/lib/raindrops/aggregate/pmq.rb
+++ b/lib/raindrops/aggregate/pmq.rb
@@ -3,8 +3,8 @@
 require "aggregate"
 require "posix_mq"
 require "fcntl"
-require "io/extra"
 require "thread"
+require "stringio"
 
 # \Aggregate + POSIX message queues support for Ruby 1.9 and \Linux
 #
@@ -19,7 +19,6 @@
 # or libraries:
 #
 # * aggregate (tested with 0.2.2)
-# * io-extra  (tested with 1.2.3)
 # * posix_mq  (tested with 1.0.0)
 #
 # == Design
@@ -84,6 +83,7 @@ def initialize(params = {})
       @wr = File.open(t.path, "wb")
       @rd = File.open(t.path, "rb")
     end
+    @wr.sync = true
     @cached_aggregate = @aggregate
     flush_master
     @mq_send = if opts[:lossy]
@@ -151,7 +151,10 @@ def aggregate
     @cached_aggregate ||= begin
       flush
       Marshal.load(synchronize(@rd, RDLOCK) do |rd|
-        IO.pread rd.fileno, rd.stat.size, 0
+        dst = StringIO.new
+        dst.binmode
+        IO.copy_stream(rd, dst, rd.stat.size, 0)
+        dst.string
       end)
     end
   end
@@ -163,7 +166,8 @@ def flush_master
     dump = Marshal.dump @aggregate
     synchronize(@wr, WRLOCK) do |wr|
       wr.truncate 0
-      IO.pwrite wr.fileno, dump, 0
+      wr.rewind
+      wr.write(dump)
     end
   end
 
diff --git a/raindrops.gemspec b/raindrops.gemspec
index c00a6b5..4651fa9 100644
--- a/raindrops.gemspec
+++ b/raindrops.gemspec
@@ -22,7 +22,6 @@
   s.test_files = test_files
   s.add_development_dependency('aggregate', '~> 0.2')
   s.add_development_dependency('test-unit', '~> 3.0')
-  s.add_development_dependency('io-extra', [ '~> 1.2', '>= 1.2.3'])
   s.add_development_dependency('posix_mq', '~> 2.0')
   s.add_development_dependency('rack', [ '>= 1.2', '< 3.0' ])
   s.add_development_dependency('olddoc', '~> 1.0')
-- 
EW


^ permalink raw reply related	[relevance 6%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-03-16  3:14  7% [PATCH 0/3] aggregate/pmq: various fixes and cleanups Eric Wong
2017-03-16  3:14  6% ` [PATCH 2/3] aggregate/pmq: remove io-extra requirement Eric Wong
2017-03-23  2:48  5% [ANN] raindrops 0.18.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).