sapience 0.2.18 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -11
- data/lib/sapience/sapience.rb +6 -6
- data/lib/sapience/version.rb +1 -1
- data/test_apps/grape/gemfiles/grape_0.16.2.gemfile.lock +1 -1
- data/test_apps/grape/gemfiles/grape_0.17.0.gemfile.lock +1 -1
- data/test_apps/rails/config/initializers/sneakers.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: e3e9c957c6a15cc33bf0a5ae91cc573b6861edc5
|
4
|
+
data.tar.gz: 5fb31b3e2cc8fa4011cd664870495530c68c4c43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed49d6d86d5c4bbde74de271ed970e86f0a612ab55730436e4884c3965ae639c555e2554424ed13a5ef11fe7baa35160dc972825da5a937326eb55fd442e840b
|
7
|
+
data.tar.gz: 2cf8507c44d60f1c9c1211df9ad76fcaac03fee8f15fab7f16e1c18a59c18f93d96644677b158ae9c8bc9e65f4bf103fbaee36d7163a371ac45b397a3ceb6c31
|
data/README.md
CHANGED
@@ -151,19 +151,19 @@ Sapience.add_appender(:datadog, url: "udp://localhost:8125")
|
|
151
151
|
|
152
152
|
The appender will then be listening to anything that is logged with a `metric: "company/project/metric-name"` key. Details about the API can be found in [dogstatsd-ruby](https://github.com/DataDog/dogstatsd-ruby).
|
153
153
|
|
154
|
-
The appender can also be used directly through: `Sapience.
|
154
|
+
The appender can also be used directly through: `Sapience.metrics`
|
155
155
|
|
156
156
|
```ruby
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
157
|
+
metrics = Sapience.metrics
|
158
|
+
metrics.timing("company/project/metric-name", 100)
|
159
|
+
metrics.increment("company/project/metric-name", 10)
|
160
|
+
metrics.decrement("company/project/metric-name", 5)
|
161
|
+
metrics.histogram("company/project/metric-name", 2_500)
|
162
|
+
metrics.gauge("company/project/metric-name", 1_000, {})
|
163
|
+
metrics.event("company/project/metric-name", "description about event", {})
|
164
|
+
metrics.batch do
|
165
|
+
metrics.event("company/project/metric-name", "description about event", {})
|
166
|
+
metrics.increment("company/project/another-metric-name", 2)
|
167
167
|
end
|
168
168
|
```
|
169
169
|
|
data/lib/sapience/sapience.rb
CHANGED
@@ -51,7 +51,7 @@ module Sapience
|
|
51
51
|
def self.reset!
|
52
52
|
@@config = nil
|
53
53
|
@@logger = nil
|
54
|
-
@@
|
54
|
+
@@metrics = nil
|
55
55
|
@@configured = false
|
56
56
|
clear_tags!
|
57
57
|
reset_appenders!
|
@@ -181,7 +181,7 @@ module Sapience
|
|
181
181
|
# Start appender thread if it is not already running
|
182
182
|
Sapience::Logger.start_appender_thread
|
183
183
|
Sapience.logger = appender if appender.is_a?(Sapience::Appender::Stream)
|
184
|
-
Sapience.
|
184
|
+
Sapience.metrics = appender if appender.is_a?(Sapience::Appender::Datadog)
|
185
185
|
appender
|
186
186
|
end
|
187
187
|
|
@@ -232,12 +232,12 @@ module Sapience
|
|
232
232
|
@@appenders.clone
|
233
233
|
end
|
234
234
|
|
235
|
-
def self.
|
236
|
-
@@
|
235
|
+
def self.metrics=(metrics)
|
236
|
+
@@metrics = metrics
|
237
237
|
end
|
238
238
|
|
239
|
-
def self.
|
240
|
-
@@
|
239
|
+
def self.metrics
|
240
|
+
@@metrics ||= Sapience.add_appender(:datadog)
|
241
241
|
end
|
242
242
|
|
243
243
|
def self.logger=(logger)
|
data/lib/sapience/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapience
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-09-
|
12
|
+
date: 2016-09-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|