skylight 0.1.3 → 0.1.4.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/skylight/gc.rb +4 -4
- data/lib/skylight/instrumenter.rb +3 -2
- data/lib/skylight/messages/trace.rb +5 -4
- data/lib/skylight/subscriber.rb +1 -1
- data/lib/skylight/util/clock.rb +12 -4
- data/lib/skylight/version.rb +1 -1
- data/lib/skylight/vm/gc.rb +4 -3
- data/lib/skylight/worker/collector.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6312c24e2ef0a54be711b60410888886646f65a0
|
4
|
+
data.tar.gz: a3dc0c4c3e2374722153c9efe12317955a37fc28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1fedcb75d67f27aa003b8926e40ea1b5eab792b07e486f3e7d1387471e388dc97b2ab85ff8239c13e1eaee593ef6a3fea468c2afd48cabbae57243a95a7b2bd
|
7
|
+
data.tar.gz: b79ffd3549eb6b0381e86707ae42fbefb2e1e74e05d622681599cfee7c3a1dc37f6edcfd24f353fb7c12546e9d7367c352edc348fb2c76097b2e6205dd84764f
|
data/CHANGELOG.md
CHANGED
data/lib/skylight/gc.rb
CHANGED
@@ -17,7 +17,7 @@ module Skylight
|
|
17
17
|
if win = Thread.current[TH_KEY]
|
18
18
|
win.time
|
19
19
|
else
|
20
|
-
0
|
20
|
+
0
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -27,7 +27,7 @@ module Skylight
|
|
27
27
|
@listeners = []
|
28
28
|
@config = config
|
29
29
|
@lock = Mutex.new
|
30
|
-
@time = 0
|
30
|
+
@time = 0
|
31
31
|
|
32
32
|
if METHODS.all? { |m| profiler.respond_to?(m) }
|
33
33
|
@profiler = profiler
|
@@ -98,7 +98,7 @@ module Skylight
|
|
98
98
|
diff = time - @time
|
99
99
|
@time = time
|
100
100
|
|
101
|
-
if diff > 0
|
101
|
+
if diff > 0
|
102
102
|
@listeners.each do |l|
|
103
103
|
l.add(diff)
|
104
104
|
end
|
@@ -110,7 +110,7 @@ module Skylight
|
|
110
110
|
|
111
111
|
def initialize(global)
|
112
112
|
@global = global
|
113
|
-
@time = 0
|
113
|
+
@time = 0
|
114
114
|
end
|
115
115
|
|
116
116
|
def update
|
@@ -79,7 +79,7 @@ module Skylight
|
|
79
79
|
return yield(trace)
|
80
80
|
end
|
81
81
|
|
82
|
-
trace = Messages::Trace::Builder.new(endpoint, Util::Clock.
|
82
|
+
trace = Messages::Trace::Builder.new(endpoint, Util::Clock.micros, @config)
|
83
83
|
|
84
84
|
begin
|
85
85
|
|
@@ -112,7 +112,8 @@ module Skylight
|
|
112
112
|
private
|
113
113
|
|
114
114
|
def process(trace)
|
115
|
-
t { fmt "processing trace; spans=%d",
|
115
|
+
t { fmt "processing trace; spans=%d; duration=%d",
|
116
|
+
trace.spans.length, trace.spans[-1].duration }
|
116
117
|
unless @worker.submit(trace)
|
117
118
|
warn "failed to submit trace to worker"
|
118
119
|
end
|
@@ -19,7 +19,7 @@ module Skylight
|
|
19
19
|
attr_accessor :endpoint
|
20
20
|
attr_reader :spans, :config
|
21
21
|
|
22
|
-
def initialize(endpoint = "Unknown", start = Util::Clock.
|
22
|
+
def initialize(endpoint = "Unknown", start = Util::Clock.micros, config = nil)
|
23
23
|
@endpoint = endpoint
|
24
24
|
@busted = false
|
25
25
|
@config = config
|
@@ -44,12 +44,13 @@ module Skylight
|
|
44
44
|
yield
|
45
45
|
ensure
|
46
46
|
unless @busted
|
47
|
-
now = Util::Clock.
|
47
|
+
now = Util::Clock.micros
|
48
48
|
|
49
49
|
GC.update
|
50
50
|
gc_time = GC.time
|
51
51
|
|
52
52
|
if gc_time > 0
|
53
|
+
t { fmt "tracking GC time; duration=%d", gc_time }
|
53
54
|
start(now - gc_time, 'noise.gc')
|
54
55
|
stop(now)
|
55
56
|
end
|
@@ -170,9 +171,9 @@ module Skylight
|
|
170
171
|
|
171
172
|
def relativize(time)
|
172
173
|
if parent = @parents[-1]
|
173
|
-
(
|
174
|
+
((time - parent.absolute_time) / 100).to_i
|
174
175
|
else
|
175
|
-
(
|
176
|
+
((time - @start) / 100).to_i
|
176
177
|
end
|
177
178
|
end
|
178
179
|
|
data/lib/skylight/subscriber.rb
CHANGED
data/lib/skylight/util/clock.rb
CHANGED
@@ -2,13 +2,21 @@ module Skylight
|
|
2
2
|
module Util
|
3
3
|
class Clock
|
4
4
|
|
5
|
-
def
|
5
|
+
def micros
|
6
6
|
n = Time.now
|
7
|
-
n.to_i + n.usec
|
7
|
+
n.to_i * 1_000_000 + n.usec
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def secs
|
11
|
+
micros / 1_000_000
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.micros
|
15
|
+
default.micros
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.secs
|
19
|
+
default.secs
|
12
20
|
end
|
13
21
|
|
14
22
|
def self.default
|
data/lib/skylight/version.rb
CHANGED
data/lib/skylight/vm/gc.rb
CHANGED
@@ -31,7 +31,7 @@ module Skylight
|
|
31
31
|
|
32
32
|
class GC
|
33
33
|
def initialize
|
34
|
-
@total = 0
|
34
|
+
@total = 0
|
35
35
|
end
|
36
36
|
|
37
37
|
def enable
|
@@ -39,7 +39,8 @@ module Skylight
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def total_time
|
42
|
-
|
42
|
+
# Reported in seconds
|
43
|
+
run = (::GC::Profiler.total_time * 1_000_000).to_i
|
43
44
|
|
44
45
|
if run > 0
|
45
46
|
::GC::Profiler.clear
|
@@ -59,7 +60,7 @@ module Skylight
|
|
59
60
|
end
|
60
61
|
|
61
62
|
def total_time
|
62
|
-
0
|
63
|
+
0
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -156,9 +156,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
156
|
version: 1.9.2
|
157
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
|
-
- - '
|
159
|
+
- - '>'
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
161
|
+
version: 1.3.1
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
164
|
rubygems_version: 2.0.3
|