remnant 0.4.9 → 0.4.10

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/lib/remnant/queue.rb CHANGED
@@ -27,25 +27,25 @@ class Remnant
27
27
  app_queue_start = ::Remnant::Discover.results.delete('app_queue_start')
28
28
 
29
29
  if lb_queue_start && fe_queue_start
30
- ms = (fe_queue_start - lb_queue_start).round(2) # ms
30
+ secs = fe_queue_start - lb_queue_start
31
31
 
32
32
  # if negative, clamp to 0
33
- if ms < 0
34
- ms = 0
33
+ if secs < 0.0
34
+ secs = 0
35
35
  end
36
36
 
37
- ::Remnant::Discover.results['queue_lb'] = ms
37
+ ::Remnant::Discover.results['queue_lb'] = (secs * 1_000.0).round(2) # ms
38
38
  end
39
39
 
40
40
  if fe_queue_start && app_queue_start
41
- ms = (app_queue_start - fe_queue_start).round(2) # ms
41
+ secs = app_queue_start - fe_queue_start
42
42
 
43
43
  # if negative, clamp to 0
44
- if ms < 0
45
- ms = 0
44
+ if secs < 0.0
45
+ secs = 0
46
46
  end
47
47
 
48
- ::Remnant::Discover.results['queue_fe'] = ms
48
+ ::Remnant::Discover.results['queue_fe'] = (secs * 1_000.0).round(2) # ms
49
49
  end
50
50
  end
51
51
 
@@ -79,15 +79,15 @@ class Remnant
79
79
  end
80
80
  end
81
81
 
82
- # bring everything into a millisecond precision
82
+ # bring everything into a seconds with millisecond precision
83
83
  def parse_timestamp(string, unit = :second)
84
84
  case unit
85
85
  when :second
86
- string.to_f * 1_000.0
87
- when :millisecond
88
86
  string.to_f
89
- when :microsecond
87
+ when :millisecond
90
88
  string.to_f / 1_000
89
+ when :microsecond
90
+ string.to_f / 1_000_000
91
91
  end
92
92
  end
93
93
  end
@@ -1,3 +1,3 @@
1
1
  class Remnant
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.10"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remnant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 9
10
- version: 0.4.9
9
+ - 10
10
+ version: 0.4.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - John 'asceth' Long