mettric 1.0.1 → 1.0.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: 6e72848b9b356c3b3a0addaf524e59207429e2c6
4
- data.tar.gz: 2d655d11eeb5a3abd907add4a29b3a2609978541
3
+ metadata.gz: c9c0f4b15e67bc9cbb35079f025caaeae9d9c2d8
4
+ data.tar.gz: 60854d39779f0a4b53c8a43803f66e8031e4b6c4
5
5
  SHA512:
6
- metadata.gz: fb250683a0b268de922c5ab681c52850201e73ca5a7958bf8eb0ee2c6c147ebf935a89ca57abc9abcd2de5e7cacbb1f972ff1340c5aefd6c2e9f41d0bd93f310
7
- data.tar.gz: 6c03a06660586e111b5a6742b5ce2fbee5f8c36888585dc390ac4f7b417b5cfb7151c4f54eae7578be1bf0435a5e0f471a0ade50cf352db497c8507aab31e0fd
6
+ metadata.gz: 1e3e34f241900b3df69b4c66544637e3a78308c2fe389effdef160bb0f343fa1bee9cdb898d408c4503e0a341d1645a1d69827e107395808c3c75416cea1f720
7
+ data.tar.gz: 9832a9e60f531dab1f1a941e2bea4c09e51c1e4bf1305bb9ef5eb2576645c8d78d0f4943c8d943a8dfe0f8e9bca8ed759b05c9a5eac49210f45e620e20aaf4fc
@@ -1,3 +1,7 @@
1
+ 1.0.2 (2016-08-19)
2
+ ==================
3
+ - Make Mettric.time more robust to rieman-server errors
4
+
1
5
  1.0.1 (2016-08-19)
2
6
  ==================
3
7
  - Change behaviour of Mettric.time and ⏱
@@ -54,18 +54,24 @@ class Mettric
54
54
  exception = e
55
55
  state = 'failure'
56
56
  end
57
- timing_payload = payload.dup
58
- timing_payload[:service] = "#{payload[:service]}.duration"
59
- timing_payload[:metric] = ((Time.now - start) * 1000).to_i
60
- timing_payload[:description] = [payload[:description], "(ms)"].compact.join(' ')
61
- timing_payload[:tags] = (payload[:tags] || []) + [:timing]
62
- track(timing_payload)
57
+
58
+ # Be super conservative, always return the result
59
+ begin
60
+ timing_payload = payload.dup
61
+ timing_payload[:service] = "#{payload[:service]}.duration"
62
+ timing_payload[:metric] = ((Time.now - start) * 1000).to_i
63
+ timing_payload[:description] = [payload[:description], "(ms)"].compact.join(' ')
64
+ timing_payload[:tags] = (payload[:tags] || []) + [:timing]
65
+ track(timing_payload)
66
+ rescue
67
+ result
68
+ end
63
69
 
64
70
  if exception
65
- event(service: "#{payload[:service]}.failure", tags: payload[:tags], description: exception.to_s)
71
+ event(service: "#{payload[:service]}.failure", tags: payload[:tags], description: exception.to_s) rescue nil
66
72
  raise exception
67
73
  else
68
- event(service: "#{payload[:service]}.success", tags: payload[:tags])
74
+ event(service: "#{payload[:service]}.success", tags: payload[:tags]) rescue result
69
75
  end
70
76
  result
71
77
  end
@@ -1,3 +1,3 @@
1
1
  class Mettric
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -20,7 +20,6 @@ class Mettric::Worker
20
20
  deliver(client, payload)
21
21
  end
22
22
  end
23
- binding.pry
24
23
  end
25
24
 
26
25
  def stop
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mettric
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-19 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport