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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26c9a55f5ae8de27e0b1607ba223096d78e5e6dd
4
- data.tar.gz: 61ffda192893aed8a11f769b55e31ba12cf364fd
3
+ metadata.gz: 9ca420677755ff0041326907530a7887a2f8a328
4
+ data.tar.gz: 6dc9025653e4cf087d16cc94d4c69be7e841879a
5
5
  SHA512:
6
- metadata.gz: e747d3db5d12695d933acb7b92dfb1ff564b8a8dbdc9e78ced3bbe1763d9b07276a1ab9d7edabf0c4b694daa147551cf3e99c31e27a35bbb723548eec5970f22
7
- data.tar.gz: 5d178d6e1c0a16ee59edf0d53fcab5799cf80fa528f148f79bdf6caf714dcad26589441139b18c016df4ce9bbbe072613aa051dcfda82ba07c91fa89de245477
6
+ metadata.gz: bae5184971387ed286e27d9fd7ed4ef8f988f85853fa50fe6f72a64fa7fbd61fcd9868e405a957c5ca7b40598a25de510fff765a5454e04f949379ec4bf0867e
7
+ data.tar.gz: cca579bdcd94979119200aaee7ecba688f1e17d26386fefa7635551effdeb54f1180a6a6b46be20dde089b59cc0091067608333d70898225defa3d1baa8dc695
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heimdall_apm (0.1.0)
4
+ heimdall_apm (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
- break if @stopped
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,
@@ -1,3 +1,3 @@
1
1
  module HeimdallApm
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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 00:00:00.000000000 Z
11
+ date: 2018-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler