raindrops 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
data/.wrongdoc.yml CHANGED
@@ -2,3 +2,5 @@
2
2
  cgit_url: http://bogomips.org/raindrops.git
3
3
  git_url: git://bogomips.org/raindrops.git
4
4
  rdoc_url: http://raindrops.bogomips.org/
5
+ public_email: raindrops@librelist.org
6
+ private_email: raindrops@bogomips.org
data/GIT-VERSION-GEN CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v0.11.0
4
+ DEF_VER=v0.12.0
5
5
 
6
6
  LF='
7
7
  '
data/README CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Raindrops is a real-time stats toolkit to show statistics for Rack HTTP
4
4
  servers. It is designed for preforking servers such as Rainbows! and
5
- Unicorn, but should support any Rack HTTP server under Ruby 1.9, 1.8 and
6
- Rubinius on platforms supporting POSIX shared memory. It may also be
7
- used as a generic scoreboard for sharing atomic counters across multiple
8
- processes.
5
+ Unicorn, but should support any Rack HTTP server under Ruby 2.0, 1.9,
6
+ 1.8 and Rubinius on platforms supporting POSIX shared memory. It may
7
+ also be used as a generic scoreboard for sharing atomic counters across
8
+ multiple processes.
9
9
 
10
10
  == Features
11
11
 
@@ -20,6 +20,7 @@ int main(int argc, char * const argv[]) {
20
20
  unsigned long i = 0;
21
21
  __sync_lock_test_and_set(&i, 0);
22
22
  __sync_lock_test_and_set(&i, 1);
23
+ __sync_bool_compare_and_swap(&i, 0, 1);
23
24
  __sync_add_and_fetch(&i, argc);
24
25
  __sync_sub_and_fetch(&i, argc);
25
26
  return 0;
@@ -30,7 +31,17 @@ SRC
30
31
  $defs.push(format("-DHAVE_GCC_ATOMIC_BUILTINS"))
31
32
  true
32
33
  else
33
- false
34
+ # some compilers still target 386 by default, but we need at least 486
35
+ # to run atomic builtins.
36
+ prev_cflags = $CFLAGS
37
+ $CFLAGS += " -march=i486 "
38
+ if try_link(src)
39
+ $defs.push(format("-DHAVE_GCC_ATOMIC_BUILTINS"))
40
+ true
41
+ else
42
+ prev_cflags = $CFLAGS
43
+ false
44
+ end
34
45
  end
35
46
  end or have_header('atomic_ops.h') or abort <<-SRC
36
47
 
@@ -586,8 +586,6 @@ static VALUE tcp_stats(struct nogvl_args *args, VALUE addr)
586
586
  */
587
587
  static VALUE tcp_listener_stats(int argc, VALUE *argv, VALUE self)
588
588
  {
589
- VALUE *ary;
590
- long i;
591
589
  VALUE rv = rb_hash_new();
592
590
  struct nogvl_args args;
593
591
  VALUE addrs, sock;
@@ -610,20 +608,26 @@ static VALUE tcp_listener_stats(int argc, VALUE *argv, VALUE self)
610
608
  case T_STRING:
611
609
  rb_hash_aset(rv, addrs, tcp_stats(&args, addrs));
612
610
  return rv;
613
- case T_ARRAY:
614
- ary = RARRAY_PTR(addrs);
615
- i = RARRAY_LEN(addrs);
616
- if (i == 1) {
617
- rb_hash_aset(rv, *ary, tcp_stats(&args, *ary));
611
+ case T_ARRAY: {
612
+ long i;
613
+ long len = RARRAY_LEN(addrs);
614
+ VALUE cur;
615
+
616
+ if (len == 1) {
617
+ cur = rb_ary_entry(addrs, 0);
618
+
619
+ rb_hash_aset(rv, cur, tcp_stats(&args, cur));
618
620
  return rv;
619
621
  }
620
- for (; --i >= 0; ary++) {
622
+ for (i = 0; i < len; i++) {
621
623
  union any_addr check;
624
+ VALUE cur = rb_ary_entry(addrs, i);
622
625
 
623
- parse_addr(&check, *ary);
624
- rb_hash_aset(rv, *ary, Qtrue);
626
+ parse_addr(&check, cur);
627
+ rb_hash_aset(rv, cur, Qtrue);
625
628
  }
626
629
  /* fall through */
630
+ }
627
631
  case T_NIL:
628
632
  args.table = st_init_strtable();
629
633
  gen_bytecode_all(&args.iov[2]);
data/test/test_watcher.rb CHANGED
@@ -154,7 +154,12 @@ class TestWatcher < Test::Unit::TestCase
154
154
  assert_equal before, headers["X-Last-Peak-At"], headers.inspect
155
155
 
156
156
  @ios << @srv.accept
157
- assert_raises(Errno::EAGAIN) { @srv.accept_nonblock }
157
+ begin
158
+ @srv.accept_nonblock
159
+ assert false, "we should not get here"
160
+ rescue => e
161
+ assert_kind_of Errno::EAGAIN, e
162
+ end
158
163
  sleep 0.1
159
164
  env = @req.class.env_for "/queued/#@addr.txt"
160
165
  status, headers, body = @app.call(env.dup)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: !binary |-
3
3
  cmFpbmRyb3Bz
4
4
  version: !ruby/object:Gem::Version
5
- version: 0.11.0
5
+ version: 0.12.0
6
6
  prerelease:
7
7
  platform: ruby
8
8
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-04-20 00:00:00.000000000 Z
14
+ date: 2013-09-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: !binary |-
@@ -133,13 +133,13 @@ description: ! 'Raindrops is a real-time stats toolkit to show statistics for Ra
133
133
 
134
134
  servers. It is designed for preforking servers such as Rainbows! and
135
135
 
136
- Unicorn, but should support any Rack HTTP server under Ruby 1.9, 1.8 and
136
+ Unicorn, but should support any Rack HTTP server under Ruby 2.0, 1.9,
137
137
 
138
- Rubinius on platforms supporting POSIX shared memory. It may also be
138
+ 1.8 and Rubinius on platforms supporting POSIX shared memory. It may
139
139
 
140
- used as a generic scoreboard for sharing atomic counters across multiple
140
+ also be used as a generic scoreboard for sharing atomic counters across
141
141
 
142
- processes.'
142
+ multiple processes.'
143
143
  email: !binary |-
144
144
  cmFpbmRyb3BzQGxpYnJlbGlzdC5vcmc=
145
145
  executables: []