mettric 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -2
- data/lib/mettric/client.rb +1 -1
- data/lib/mettric/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: 08cdfaf00799db2eafb16139724b95f0b0b9fed6
|
4
|
+
data.tar.gz: 8c1c7e145b57ddfd9f79df0720b7cd8a7ed4e5a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 746ead2be6615e86d659e89928a41b826e5d6d1e14b50637e46a5e693c8134c38e407f6b392999ea61444f80440d4651ec84b287df09b2f36e12053f22f7d762
|
7
|
+
data.tar.gz: 3ac48229d7ecc2aedd0f637d5d37289e5fc6a1f8b85812194000a5ef567ac4119630eabf344586db349d28b5fba37a58a31a4169dfa228ba81571bf9dea1568b
|
data/README.md
CHANGED
@@ -15,7 +15,14 @@ Mettric.config = {
|
|
15
15
|
}
|
16
16
|
```
|
17
17
|
|
18
|
-
## Track
|
18
|
+
## Track events
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
# Tracks payload with metric=1 and tags it 'event'
|
22
|
+
🛎 service: 'User created'
|
23
|
+
```
|
24
|
+
|
25
|
+
## Track meter readings
|
19
26
|
|
20
27
|
```ruby
|
21
28
|
🌡 service: 'Rails req/s', metric: 400, state: 'normal'
|
@@ -25,7 +32,8 @@ Mettric.config = {
|
|
25
32
|
|
26
33
|
```ruby
|
27
34
|
# This will track the duration in milliseconds as the `metric` value
|
28
|
-
|
35
|
+
# as "Sleep duration ms" (note the added ' ms') and tag it 'timing'
|
36
|
+
⏱ (service: 'Sleep duration') do
|
29
37
|
sleep 1
|
30
38
|
end
|
31
39
|
```
|
data/lib/mettric/client.rb
CHANGED
@@ -72,7 +72,7 @@ class Mettric::Client
|
|
72
72
|
out = stringify(payload)
|
73
73
|
raise Mettric::MissingService, out if out[:service].blank?
|
74
74
|
|
75
|
-
out[:tags] = [out[:tags], :mettric].flatten.compact.uniq
|
75
|
+
out[:tags] = [out[:tags], :mettric].flatten.compact.uniq.map(&:to_s)
|
76
76
|
out[:tags] << env if env.present?
|
77
77
|
out[:metric] ||= 1
|
78
78
|
|
data/lib/mettric/version.rb
CHANGED