sapience 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sapience/appender/datadog.rb +8 -2
- data/lib/sapience/appender/sentry.rb +2 -1
- data/lib/sapience/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e155af8dbe1159b4b409fed3f1c38d1aa88cf0
|
4
|
+
data.tar.gz: 4d49d889a237f8dbd67bf0cb1880387c24e1cb2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0311c050dcf515ab0065b30bf238b06ecd6c9097d928267ed9577e383f027f1369297673a0659054cd378df07f455107bb45f8e7e4e8a45a3cfd1252b32dc384
|
7
|
+
data.tar.gz: caaad7563aa780619c6ec95ceb04da80b61804cec4317bc9d47cb3a4f9016cba3bfe36dbae102eb6ae965b5f53c2658af3f135aca1c88d13993286fd289fd2aa
|
data/CHANGELOG.md
CHANGED
@@ -64,8 +64,14 @@ module Sapience
|
|
64
64
|
true
|
65
65
|
end
|
66
66
|
|
67
|
-
def timing(metric, duration)
|
68
|
-
|
67
|
+
def timing(metric, duration = 0)
|
68
|
+
if block_given?
|
69
|
+
start = Time.now
|
70
|
+
yield
|
71
|
+
provider.timing(metric, ((Time.now - start)*1000).floor)
|
72
|
+
else
|
73
|
+
provider.timing(metric, duration)
|
74
|
+
end
|
69
75
|
end
|
70
76
|
|
71
77
|
def increment(metric, amount = 1)
|
@@ -51,7 +51,8 @@ module Sapience
|
|
51
51
|
def validate_options!(options = {})
|
52
52
|
fail ArgumentError, "Options should be a Hash" unless options.is_a?(Hash)
|
53
53
|
fail ArgumentError, "Options need to have the key :dsn" unless options.key?(:dsn)
|
54
|
-
|
54
|
+
dsn_valid = options[:dsn] =~ URI::DEFAULT_PARSER.regexp[:ABS_URI]
|
55
|
+
fail ArgumentError, "The :dsn key is not a valid URI" unless dsn_valid
|
55
56
|
end
|
56
57
|
|
57
58
|
# Send an error notification to sentry
|
data/lib/sapience/version.rb
CHANGED