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 +4 -4
- data/CHANGELOG.markdown +4 -0
- data/lib/mettric/mettric.rb +14 -8
- data/lib/mettric/version.rb +1 -1
- data/lib/mettric/worker.rb +0 -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: c9c0f4b15e67bc9cbb35079f025caaeae9d9c2d8
|
4
|
+
data.tar.gz: 60854d39779f0a4b53c8a43803f66e8031e4b6c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e3e34f241900b3df69b4c66544637e3a78308c2fe389effdef160bb0f343fa1bee9cdb898d408c4503e0a341d1645a1d69827e107395808c3c75416cea1f720
|
7
|
+
data.tar.gz: 9832a9e60f531dab1f1a941e2bea4c09e51c1e4bf1305bb9ef5eb2576645c8d78d0f4943c8d943a8dfe0f8e9bca8ed759b05c9a5eac49210f45e620e20aaf4fc
|
data/CHANGELOG.markdown
CHANGED
data/lib/mettric/mettric.rb
CHANGED
@@ -54,18 +54,24 @@ class Mettric
|
|
54
54
|
exception = e
|
55
55
|
state = 'failure'
|
56
56
|
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
data/lib/mettric/version.rb
CHANGED
data/lib/mettric/worker.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|