skylight 0.1.4.alpha2 → 0.1.4.alpha3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286237c90fbe1e0e498d06e0b53e74c4bc2f5270
4
- data.tar.gz: 9642d98ba8de748ca46e60e708a95c595d840cb2
3
+ metadata.gz: 9a5ac85593bf6bd29d00bc703adb6a05221e7b56
4
+ data.tar.gz: dd78653688a87fba4196aaa21ef9bfa1d3fc7f14
5
5
  SHA512:
6
- metadata.gz: 98e253ee2bfd462fb30f5e83da7f54c73c340cbf945224ba0a0679d5d14b9127bc5d9a918e599bf1c868afd5ec9cf794aba2b637f1f1349c911283a5ab8fee46
7
- data.tar.gz: 796c2df8fc6a41d04e7b7926204b774dbe814c82e2bee4245ed512d8e56c4f09c452e36faa279b4504e4125696843f0fb678bec4a5f69ae243f70eb395581df3
6
+ metadata.gz: dc86e86e687ad355869ac245dd936eef2949c87c66725d13055927ab4a6a76480170a85200a9a79d45668c1230c647409ec74debe9eb9e738a5ced96b5b6eb67
7
+ data.tar.gz: 5f79367f90fe5f7c362eaf910fbad90c1be5cd3f483c5c72dbc14e892998ed8bf8481bda9fc6c763ac197dedbabf08734cc7f2d37bc5a2d0c2d640aaff35751d
@@ -69,7 +69,7 @@ module Skylight
69
69
  def record(time, cat, title = nil, desc = nil, annot = {})
70
70
  return if @busted
71
71
 
72
- track_time(time)
72
+ time = adjust_for_skew(time)
73
73
 
74
74
  sp = span(time, cat, title, desc, annot)
75
75
 
@@ -84,7 +84,7 @@ module Skylight
84
84
  def start(time, cat, title = nil, desc = nil, annot = {})
85
85
  return if @busted
86
86
 
87
- track_time(time)
87
+ time = adjust_for_skew(time)
88
88
 
89
89
  sp = span(time, cat, title, desc, annot)
90
90
 
@@ -96,7 +96,7 @@ module Skylight
96
96
  def stop(time)
97
97
  return if @busted
98
98
 
99
- track_time(time)
99
+ time = adjust_for_skew(time)
100
100
 
101
101
  sp = pop
102
102
 
@@ -186,15 +186,15 @@ module Skylight
186
186
  end
187
187
  end
188
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}"
189
+ # Sadely, we don't have access to a pure monotonic clock in ruby, so we
190
+ # need to cheat a little.
191
+ def adjust_for_skew(time)
192
+ if time <= @last_seen_time
193
+ return @last_seen_time
195
194
  end
196
195
 
197
196
  @last_seen_time = time
197
+ time
198
198
  end
199
199
 
200
200
  end
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '0.1.4.alpha2'
2
+ VERSION = '0.1.4.alpha3'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.alpha2
4
+ version: 0.1.4.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.