codeclimate 0.87.1 → 0.87.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cc/analyzer/statsd_container_listener.rb +23 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a48143ec65e582ac39752b48a5a963865ac8e36c99c16e2d4dfa3835a138c3
|
4
|
+
data.tar.gz: ba0d3afc2fc5a462cf2f3ce4c783798f8f07ba4db36da42cdbce0ce3dbbd8cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8767bbbdfb65ec6a8ec40c473dc63722ab58c90fefdb1cade7b004d3ae1c8f922a4c65c000338867df90fa2f872be2093d0f1b05e2bc525f9a68f981e8381949
|
7
|
+
data.tar.gz: e88c146dcfc1117f0bb8bbb1e2e0076adda3416f430fb81cfc79c8f7c7164a41fe7b08100d86046653eb61839a2bdf6c107fdffab65593ef9940ccef258d5006
|
@@ -31,21 +31,34 @@ module CC
|
|
31
31
|
|
32
32
|
attr_reader :statsd
|
33
33
|
|
34
|
-
def increment(engine,
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
def increment(engine, metric_name)
|
35
|
+
tags = engine_tags(engine)
|
36
|
+
metrics(engine, metric_name).each { |metric| statsd.increment(metric, tags:) }
|
37
|
+
end
|
38
|
+
|
39
|
+
def timing(engine, metric_name, millis)
|
40
|
+
tags = engine_tags(engine)
|
41
|
+
metrics(engine, metric_name).each { |metric| statsd.timing(metric, millis, tags:) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def metrics(engine, metric_name)
|
45
|
+
[
|
46
|
+
"engines.#{metric_name}",
|
47
|
+
"engines.names.#{engine.name}.#{metric_name}",
|
48
|
+
].tap do |metrics|
|
49
|
+
metrics << "engines.names.#{engine.name}.#{engine.channel}.#{metric_name}" if engine_channel_present?(engine)
|
39
50
|
end
|
40
51
|
end
|
41
52
|
|
42
|
-
def
|
43
|
-
|
44
|
-
|
45
|
-
if engine.respond_to?(:channel) && engine.channel
|
46
|
-
statsd.timing("engines.names.#{engine.name}.#{engine.channel}.#{metric}", millis)
|
53
|
+
def engine_tags(engine)
|
54
|
+
["engine:#{engine.name}"].tap do |tags|
|
55
|
+
tags << "channel:#{engine.channel}" if engine_channel_present?(engine)
|
47
56
|
end
|
48
57
|
end
|
58
|
+
|
59
|
+
def engine_channel_present?(engine)
|
60
|
+
engine.respond_to?(:channel) && engine.channel
|
61
|
+
end
|
49
62
|
end
|
50
63
|
end
|
51
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.87.
|
4
|
+
version: 0.87.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|