skylight 0.1.4.alpha1 → 0.1.4.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/skylight/messages/trace.rb +20 -0
- data/lib/skylight/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 286237c90fbe1e0e498d06e0b53e74c4bc2f5270
|
4
|
+
data.tar.gz: 9642d98ba8de748ca46e60e708a95c595d840cb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98e253ee2bfd462fb30f5e83da7f54c73c340cbf945224ba0a0679d5d14b9127bc5d9a918e599bf1c868afd5ec9cf794aba2b637f1f1349c911283a5ab8fee46
|
7
|
+
data.tar.gz: 796c2df8fc6a41d04e7b7926204b774dbe814c82e2bee4245ed512d8e56c4f09c452e36faa279b4504e4125696843f0fb678bec4a5f69ae243f70eb395581df3
|
@@ -27,6 +27,9 @@ module Skylight
|
|
27
27
|
@spans = []
|
28
28
|
@stack = []
|
29
29
|
@parents = []
|
30
|
+
|
31
|
+
# Track time
|
32
|
+
@last_seen_time = start
|
30
33
|
end
|
31
34
|
|
32
35
|
def root(cat, title = nil, desc = nil, annot = {})
|
@@ -66,6 +69,8 @@ module Skylight
|
|
66
69
|
def record(time, cat, title = nil, desc = nil, annot = {})
|
67
70
|
return if @busted
|
68
71
|
|
72
|
+
track_time(time)
|
73
|
+
|
69
74
|
sp = span(time, cat, title, desc, annot)
|
70
75
|
|
71
76
|
return self if :skip == sp
|
@@ -79,6 +84,8 @@ module Skylight
|
|
79
84
|
def start(time, cat, title = nil, desc = nil, annot = {})
|
80
85
|
return if @busted
|
81
86
|
|
87
|
+
track_time(time)
|
88
|
+
|
82
89
|
sp = span(time, cat, title, desc, annot)
|
83
90
|
|
84
91
|
push(sp)
|
@@ -89,6 +96,8 @@ module Skylight
|
|
89
96
|
def stop(time)
|
90
97
|
return if @busted
|
91
98
|
|
99
|
+
track_time(time)
|
100
|
+
|
92
101
|
sp = pop
|
93
102
|
|
94
103
|
return self if :skip == sp
|
@@ -177,6 +186,17 @@ module Skylight
|
|
177
186
|
end
|
178
187
|
end
|
179
188
|
|
189
|
+
def track_time(time)
|
190
|
+
if time < @last_seen_time
|
191
|
+
@busted = true
|
192
|
+
raise TraceError, "time moving backwards; " \
|
193
|
+
"prev=#{@last_seen_time}; " \
|
194
|
+
"curr=#{time}"
|
195
|
+
end
|
196
|
+
|
197
|
+
@last_seen_time = time
|
198
|
+
end
|
199
|
+
|
180
200
|
end
|
181
201
|
|
182
202
|
end
|
data/lib/skylight/version.rb
CHANGED