raindrops 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +2 -1
- data/LICENSE +7 -5
- data/examples/linux-tcp-listener-stats.rb +17 -1
- data/ext/raindrops/linux_inet_diag.c +3 -3
- data/lib/raindrops.rb +2 -2
- metadata +17 -5
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
@@ -53,7 +53,7 @@ NEWS: GIT-VERSION-FILE
|
|
53
53
|
latest: NEWS
|
54
54
|
@awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
|
55
55
|
|
56
|
-
SINCE = 0.1
|
56
|
+
SINCE = 0.2.1
|
57
57
|
ChangeLog: LOG_VERSION = \
|
58
58
|
$(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
|
59
59
|
echo $(GIT_VERSION) || git describe)
|
@@ -181,6 +181,7 @@ publish_doc:
|
|
181
181
|
$(MAKE) -s latest > doc/LATEST
|
182
182
|
find doc/images doc/js -type f | \
|
183
183
|
TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
|
184
|
+
tar cf - $$(git ls-files examples/) | (cd doc && tar xf -)
|
184
185
|
$(MAKE) doc_gz
|
185
186
|
chmod 644 $$(find doc -type f)
|
186
187
|
$(RSYNC) -av doc/ raindrops.bogomips.org:/srv/raindrops/
|
data/LICENSE
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
raindrops is copyrighted Free Software by all contributors, see logs in
|
2
2
|
revision control for names and email addresses of all of them.
|
3
3
|
|
4
|
-
You can redistribute it and/or modify it under
|
5
|
-
Lesser General Public License as published by the Free Software
|
6
|
-
version
|
7
|
-
link:COPYING).
|
4
|
+
You can redistribute it and/or modify it under the terms of the GNU
|
5
|
+
Lesser General Public License (LGPL) as published by the Free Software
|
6
|
+
Foundation, version {2.1}[http://www.gnu.org/licenses/lgpl-2.1.txt] or
|
7
|
+
or {3}[http://www.gnu.org/licenses/lgpl-3.0.txt] (see link:COPYING).
|
8
|
+
The raindrops project leader (Eric Wong) reserves the right to
|
9
|
+
relicense raindrops under future versions of the LGPL.
|
8
10
|
|
9
|
-
|
11
|
+
raindrops is distributed in the hope that it will be useful, but WITHOUT
|
10
12
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
13
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
12
14
|
License for more details.
|
@@ -5,7 +5,8 @@
|
|
5
5
|
|
6
6
|
require 'raindrops'
|
7
7
|
require 'optparse'
|
8
|
-
|
8
|
+
require 'ipaddr'
|
9
|
+
usage = "Usage: #$0 [-d delay] ADDR..."
|
9
10
|
ARGV.size > 0 or abort usage
|
10
11
|
delay = false
|
11
12
|
|
@@ -19,6 +20,21 @@ opts = OptionParser.new('', 24, ' ') do |opts|
|
|
19
20
|
opts.parse! ARGV
|
20
21
|
end
|
21
22
|
|
23
|
+
ARGV.each do |addr|
|
24
|
+
addr =~ %r{\A(127\..+):(\d+)\z} or next
|
25
|
+
host, port = $1, $2
|
26
|
+
hex_port = '%X' % port.to_i
|
27
|
+
ip_addr = IPAddr.new(host)
|
28
|
+
hex_host = ip_addr.hton.each_byte.inject('') { |s,o| s << '%02X' % o }
|
29
|
+
socks = File.readlines('/proc/net/tcp')
|
30
|
+
hex_addr = "#{hex_host}:#{hex_port}"
|
31
|
+
if socks.grep(/^\s+\d+:\s+#{hex_addr}\s+/).empty? &&
|
32
|
+
! socks.grep(/^\s+\d+:\s+00000000:#{hex_port}\s+/).empty?
|
33
|
+
warn "W: #{host}:#{port} (#{hex_addr}) not found in /proc/net/tcp"
|
34
|
+
warn "W: Did you mean 0.0.0.0:#{port}?"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
22
38
|
fmt = "% 19s % 10u % 10u\n"
|
23
39
|
printf fmt.tr('u','s'), *%w(address active queued)
|
24
40
|
|
@@ -77,7 +77,7 @@ struct listen_stats {
|
|
77
77
|
|
78
78
|
struct nogvl_args {
|
79
79
|
struct iovec iov[3]; /* last iov holds inet_diag bytecode */
|
80
|
-
struct my_addr
|
80
|
+
struct my_addr query_addr;
|
81
81
|
struct listen_stats stats;
|
82
82
|
};
|
83
83
|
|
@@ -271,8 +271,8 @@ static VALUE tcp_stats(struct nogvl_args *args, VALUE addr)
|
|
271
271
|
const char *err;
|
272
272
|
VALUE verr;
|
273
273
|
|
274
|
-
parse_addr(&args->
|
275
|
-
gen_bytecode(&args->iov[2], &args->
|
274
|
+
parse_addr(&args->query_addr, addr);
|
275
|
+
gen_bytecode(&args->iov[2], &args->query_addr);
|
276
276
|
|
277
277
|
verr = rb_thread_blocking_region(diag, args, RUBY_UBF_IO, 0);
|
278
278
|
err = (const char *)verr;
|
data/lib/raindrops.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- encoding: binary -*-
|
2
2
|
class Raindrops
|
3
3
|
|
4
|
-
# Raindrops is currently at version 0.
|
5
|
-
VERSION = '0.
|
4
|
+
# Raindrops is currently at version 0.3.0
|
5
|
+
VERSION = '0.3.0'
|
6
6
|
|
7
7
|
# Used to represent the number of +active+ and +queued+ sockets for
|
8
8
|
# a single listen socket across all threads and processes on a
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raindrops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 19
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- raindrops hackers
|
@@ -9,7 +15,7 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-07-10 00:00:00 +00:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
@@ -77,21 +83,27 @@ rdoc_options:
|
|
77
83
|
require_paths:
|
78
84
|
- lib
|
79
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
80
87
|
requirements:
|
81
88
|
- - ">="
|
82
89
|
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
83
93
|
version: "0"
|
84
|
-
version:
|
85
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
86
96
|
requirements:
|
87
97
|
- - ">="
|
88
98
|
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
100
|
+
segments:
|
101
|
+
- 0
|
89
102
|
version: "0"
|
90
|
-
version:
|
91
103
|
requirements: []
|
92
104
|
|
93
105
|
rubyforge_project: rainbows
|
94
|
-
rubygems_version: 1.3.
|
106
|
+
rubygems_version: 1.3.7
|
95
107
|
signing_key:
|
96
108
|
specification_version: 3
|
97
109
|
summary: real-time stats for preforking Rack servers
|