yabeda-datadog 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/yabeda/datadog/units.rb +35 -22
- data/lib/yabeda/datadog/version.rb +1 -1
- data/yabeda-datadog.gemspec +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d19ca4de5083d19647d70c84ac48e8192c30107f704de5e884605184566878de
|
4
|
+
data.tar.gz: aad24d5f83a5431a47f561402bcbf1f0dc3671169b6e21d9b2fa3fce1dfbed09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9120fe159229915dd474c9f1dcda45b84874a6652e85c743b704590dcac6912a34d4e91cb519e322ab413645ede4f3642af8a37ce76c3066e5349103b02b2130
|
7
|
+
data.tar.gz: bc3b9ba60f41c04e621014dc6d808101846cad8e4274d63940a627c48e3a9e14dba27d217f1ff3d26ba643910ca7057f3b4587c645c9f8d0b28f7233d0b35a36
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yabeda-datadog (0.3.
|
4
|
+
yabeda-datadog (0.3.2)
|
5
5
|
anyway_config (~> 1.0)
|
6
6
|
dogapi
|
7
7
|
dogstatsd-ruby
|
@@ -10,11 +10,11 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
anyway_config (1.4.
|
13
|
+
anyway_config (1.4.4)
|
14
14
|
coderay (1.1.2)
|
15
15
|
concurrent-ruby (1.1.4)
|
16
16
|
diff-lcs (1.3)
|
17
|
-
dogapi (1.
|
17
|
+
dogapi (1.33.0)
|
18
18
|
multi_json
|
19
19
|
dogstatsd-ruby (4.0.0)
|
20
20
|
dry-initializer (2.5.0)
|
data/lib/yabeda/datadog/units.rb
CHANGED
@@ -4,31 +4,44 @@ module Yabeda
|
|
4
4
|
module Datadog
|
5
5
|
# = The logic of working with Datadog units
|
6
6
|
class Unit
|
7
|
+
# Datadog whitelist of units
|
7
8
|
# source: https://docs.datadoghq.com/developers/metrics/#units
|
8
|
-
AVAILABLE = [
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
9
|
+
AVAILABLE = [
|
10
|
+
"bit", "byte", "kibibyte", "mebibyte", "gibibyte", "tebibyte",
|
11
|
+
"pebibyte", "exbibyte", "nanosecond", "microsecond", "millisecond",
|
12
|
+
"second", "minute", "hour", "day", "week", "percent_nano", "percent",
|
13
|
+
"apdex", "fraction", "connection", "request", "packet", "segment",
|
14
|
+
"response", "message", "payload", "timeout", "datagram", "route",
|
15
|
+
"session", "process", "thread", "host", "node", "fault", "service",
|
16
|
+
"instance", "cpu", "file", "inode", "sector", "block", "buffer",
|
17
|
+
"error", "read", "write", "occurrence", "event", "time", "unit",
|
18
|
+
"operation", "item", "task", "worker", "resource", "garbage collection",
|
19
|
+
"email", "sample", "stage", "monitor", "location", "check", "attempt",
|
20
|
+
"device", "update", "method", "job", "container", "execution",
|
21
|
+
"throttle", "invocation", "user", "success", "build", "prediction",
|
22
|
+
"table", "index", "lock", "transaction", "query", "row", "key",
|
23
|
+
"command", "offset", "record", "object", "cursor", "assertion", "scan",
|
24
|
+
"document", "shard", "flush", "merge", "refresh", "fetch", "column",
|
25
|
+
"commit", "wait", "ticket", "question", "hit", "miss", "eviction",
|
26
|
+
"get", "set", "dollar", "cent", "page", "split", "hertz", "kilohertz",
|
27
|
+
"megahertz", "gigahertz", "entry", "degree celsius", "degree fahrenheit",
|
28
|
+
"nanocore", "microcore", "millicore", "core", "kilocore", "megacore",
|
29
|
+
"gigacore", "teracore", "petacore", "exacore",
|
30
|
+
].map { |unit| [unit, unit] }.to_h.freeze
|
28
31
|
|
29
|
-
|
32
|
+
IRREGULAR_PLURALS = {
|
33
|
+
"queries" => "query",
|
34
|
+
"entries" => "entry",
|
35
|
+
"indices" => "index",
|
36
|
+
}.freeze
|
37
|
+
|
38
|
+
# Find an available unit of metric
|
30
39
|
def self.find(unit)
|
31
|
-
|
40
|
+
unit_key = unit.to_s.downcase
|
41
|
+
AVAILABLE[unit_key] ||
|
42
|
+
AVAILABLE[unit_key.gsub(/s\z/, "")] ||
|
43
|
+
AVAILABLE[unit_key.gsub(/es\z/, "")] ||
|
44
|
+
IRREGULAR_PLURALS[unit_key]
|
32
45
|
end
|
33
46
|
end
|
34
47
|
end
|
data/yabeda-datadog.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.metadata["homepage_uri"] = spec.homepage
|
21
21
|
spec.metadata["source_code_uri"] = spec.homepage
|
22
22
|
|
23
|
-
spec.files = Dir.chdir(File.expand_path(__dir__
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
24
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
25
|
end
|
26
26
|
spec.bindir = "exe"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-datadog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Shvetsov <@shvetsovdm>
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anyway_config
|
@@ -180,8 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
|
184
|
-
rubygems_version: 2.7.6
|
183
|
+
rubygems_version: 3.0.1
|
185
184
|
signing_key:
|
186
185
|
specification_version: 4
|
187
186
|
summary: DataDog adapter for reporting metrics from Yabeda suite
|