onis 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +10 -2
- data/lib/onis/web.rb +14 -0
- data/onis.gemspec +3 -2
- metadata +14 -6
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Onis gives you introspection into object counts of live running ruby process.
|
|
11
11
|
|
12
12
|
$ cd onis/
|
13
13
|
|
14
|
-
$ cat test/
|
14
|
+
$ cat test/stringpwnd.rb
|
15
15
|
require 'onis'
|
16
16
|
puts Process.pid
|
17
17
|
a = []
|
@@ -44,9 +44,17 @@ Onis gives you introspection into object counts of live running ruby process.
|
|
44
44
|
$ onis -f -c 26584
|
45
45
|
|
46
46
|
## Watch!
|
47
|
-
|
47
|
+
|
48
48
|
$ onis -w 26584
|
49
49
|
|
50
|
+
## Web!
|
51
|
+
|
52
|
+
# config.ru or Rails metal
|
53
|
+
|
54
|
+
map '/onis' do
|
55
|
+
run Onis::Web
|
56
|
+
end
|
57
|
+
|
50
58
|
## How it works
|
51
59
|
|
52
60
|
1. Onis drops a tempfile named after the pid `onis.<pid>`
|
data/lib/onis/web.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'onis/base'
|
2
|
+
|
3
|
+
module Onis
|
4
|
+
module Web
|
5
|
+
def self.call(env)
|
6
|
+
table = Onis::ObjectInspector.all.map do |k,c|
|
7
|
+
"<tr><td>" + k.name + "</td><td>" + c.to_s + "</td></tr>"
|
8
|
+
end.join("")
|
9
|
+
p table
|
10
|
+
body = "<html><body><table>" + table + "</table></body></html>"
|
11
|
+
[200, { "Content-Type" => body.length.to_s }, [body]]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/onis.gemspec
CHANGED
@@ -3,10 +3,10 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = 'onis'
|
6
|
-
s.version = '0.1
|
6
|
+
s.version = '0.2.1'
|
7
7
|
s.date = '2009-10-27'
|
8
8
|
|
9
|
-
s.description = "Live ObjectSpace introspection"
|
9
|
+
s.description = "Live ObjectSpace introspection (With Rack endpoint)"
|
10
10
|
s.summary = s.description
|
11
11
|
|
12
12
|
s.authors = ["Blake Mizerany"]
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
onis.gemspec
|
18
18
|
lib/onis.rb
|
19
19
|
lib/onis/base.rb
|
20
|
+
lib/onis/web.rb
|
20
21
|
bin/onis
|
21
22
|
]
|
22
23
|
s.executables = ['onis']
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Blake Mizerany
|
@@ -13,7 +18,7 @@ date: 2009-10-27 00:00:00 -07:00
|
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
16
|
-
description: Live ObjectSpace introspection
|
21
|
+
description: Live ObjectSpace introspection (With Rack endpoint)
|
17
22
|
email: blake.mizerany@gmail.com
|
18
23
|
executables:
|
19
24
|
- onis
|
@@ -26,6 +31,7 @@ files:
|
|
26
31
|
- onis.gemspec
|
27
32
|
- lib/onis.rb
|
28
33
|
- lib/onis/base.rb
|
34
|
+
- lib/onis/web.rb
|
29
35
|
- bin/onis
|
30
36
|
has_rdoc: true
|
31
37
|
homepage: http://github.com/bmizerany/onis/
|
@@ -40,20 +46,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
46
|
requirements:
|
41
47
|
- - ">="
|
42
48
|
- !ruby/object:Gem::Version
|
49
|
+
segments:
|
50
|
+
- 0
|
43
51
|
version: "0"
|
44
|
-
version:
|
45
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
53
|
requirements:
|
47
54
|
- - ">="
|
48
55
|
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 0
|
49
58
|
version: "0"
|
50
|
-
version:
|
51
59
|
requirements: []
|
52
60
|
|
53
61
|
rubyforge_project:
|
54
|
-
rubygems_version: 1.3.
|
62
|
+
rubygems_version: 1.3.6
|
55
63
|
signing_key:
|
56
64
|
specification_version: 2
|
57
|
-
summary: Live ObjectSpace introspection
|
65
|
+
summary: Live ObjectSpace introspection (With Rack endpoint)
|
58
66
|
test_files: []
|
59
67
|
|