remnant 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/remnant/queue.rb +12 -12
- data/lib/remnant/version.rb +1 -1
- metadata +3 -3
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
|
-
|
30
|
+
secs = fe_queue_start - lb_queue_start
|
31
31
|
|
32
32
|
# if negative, clamp to 0
|
33
|
-
if
|
34
|
-
|
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
|
-
|
41
|
+
secs = app_queue_start - fe_queue_start
|
42
42
|
|
43
43
|
# if negative, clamp to 0
|
44
|
-
if
|
45
|
-
|
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 :
|
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
|
data/lib/remnant/version.rb
CHANGED
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 10
|
10
|
+
version: 0.4.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John 'asceth' Long
|