heimdall_apm 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/heimdall_apm/agent.rb +9 -1
- data/lib/heimdall_apm/points_collection.rb +1 -3
- data/lib/heimdall_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ca420677755ff0041326907530a7887a2f8a328
|
4
|
+
data.tar.gz: 6dc9025653e4cf087d16cc94d4c69be7e841879a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae5184971387ed286e27d9fd7ed4ef8f988f85853fa50fe6f72a64fa7fbd61fcd9868e405a957c5ca7b40598a25de510fff765a5454e04f949379ec4bf0867e
|
7
|
+
data.tar.gz: cca579bdcd94979119200aaee7ecba688f1e17d26386fefa7635551effdeb54f1180a6a6b46be20dde089b59cc0091067608333d70898225defa3d1baa8dc695
|
data/Gemfile.lock
CHANGED
data/lib/heimdall_apm/agent.rb
CHANGED
@@ -56,11 +56,15 @@ module HeimdallApm
|
|
56
56
|
options[:app].config.middleware.insert_after Rack::Cors, HeimdallApm::Instruments::Middleware
|
57
57
|
end
|
58
58
|
|
59
|
+
# TODO: handle platform/webserver that don't handle this correctly
|
60
|
+
at_exit { stop }
|
61
|
+
|
59
62
|
context.started!
|
60
63
|
@background_thread = Thread.new { background_run }
|
61
64
|
end
|
62
65
|
|
63
66
|
def stop
|
67
|
+
HeimdallApm.logger.info 'Stopping agent...'
|
64
68
|
@stopped = true
|
65
69
|
context.stopped!
|
66
70
|
if @background_thread.alive?
|
@@ -79,7 +83,11 @@ module HeimdallApm
|
|
79
83
|
loop do
|
80
84
|
now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
81
85
|
|
82
|
-
|
86
|
+
if @stopped
|
87
|
+
# Commit data before stopping
|
88
|
+
reporting.call
|
89
|
+
break
|
90
|
+
end
|
83
91
|
|
84
92
|
if now < next_time
|
85
93
|
remaining = next_time - now
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'set'
|
4
|
-
|
5
3
|
module HeimdallApm
|
6
4
|
# Convert metrics hash from requests into an collection of points we want to
|
7
5
|
# track, but without aggregations and percentiles/std_dev calculations of same
|
@@ -51,7 +49,7 @@ module HeimdallApm
|
|
51
49
|
end
|
52
50
|
|
53
51
|
# Segment time are in seconds, store them in milliseconds
|
54
|
-
values.transform_values! { |v| v * 1000 }
|
52
|
+
values.transform_values! { |v| v.is_a?(Integer) ? v : v * 1000 }
|
55
53
|
|
56
54
|
@points << {
|
57
55
|
series: series_name,
|
data/lib/heimdall_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heimdall_apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Cocchi-Perrier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|