codeclimate 0.73.0 → 0.74.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/cc/analyzer/engine.rb +5 -2
- data/lib/cc/analyzer/statsd_container_listener.rb +20 -14
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 34ac95420d3727f08da87c7eaee9385ca4bbdc28
|
4
|
+
data.tar.gz: 1020c9604094e1e3fec237218f5ecd95ef9650a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90311c1e55a6923cf0af2e33c942e41090427a7f9690399fe52057d93f862cc8654c95ccc8863a75474baaa43b03ae032ea9819a87a028310f44da893f816d9e
|
7
|
+
data.tar.gz: 6118ab05a82a09e5c351b5916d14ee20a48f6d6a3176bc5ca4bc1a56fde12c2b44743003bd1cc7b4755e0ef563c805f47cde17e0aff2f939d8f5092ec2dafcd3
|
data/lib/cc/analyzer/engine.rb
CHANGED
@@ -74,11 +74,10 @@ module CC
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def container_options
|
77
|
-
[
|
77
|
+
options = [
|
78
78
|
"--cap-drop", "all",
|
79
79
|
"--label", "com.codeclimate.label=#{@label}",
|
80
80
|
"--log-driver", "none",
|
81
|
-
"--memory", metadata["memory"].to_s,
|
82
81
|
"--memory-swap", "-1",
|
83
82
|
"--net", "none",
|
84
83
|
"--rm",
|
@@ -86,6 +85,10 @@ module CC
|
|
86
85
|
"--volume", "#{config_file.host_path}:/config.json:ro",
|
87
86
|
"--user", "9000:9000"
|
88
87
|
]
|
88
|
+
if (memory = metadata["memory"]).present?
|
89
|
+
options.concat(["--memory", memory.to_s])
|
90
|
+
end
|
91
|
+
options
|
89
92
|
end
|
90
93
|
|
91
94
|
def container_name
|
@@ -6,24 +6,24 @@ module CC
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def started(engine, _details)
|
9
|
-
increment(engine
|
9
|
+
increment(engine, "started")
|
10
10
|
end
|
11
11
|
|
12
12
|
def finished(engine, _details, result)
|
13
|
-
timing(engine
|
14
|
-
increment(engine
|
13
|
+
timing(engine, "time", result.duration)
|
14
|
+
increment(engine, "finished")
|
15
15
|
|
16
16
|
if result.timed_out?
|
17
|
-
timing(engine
|
18
|
-
increment(engine
|
19
|
-
increment(engine
|
17
|
+
timing(engine, "time", result.duration)
|
18
|
+
increment(engine, "result.error")
|
19
|
+
increment(engine, "result.error.timeout")
|
20
20
|
elsif result.maximum_output_exceeded?
|
21
|
-
increment(engine
|
22
|
-
increment(engine
|
21
|
+
increment(engine, "result.error")
|
22
|
+
increment(engine, "result.error.output_exceeded")
|
23
23
|
elsif result.exit_status.nonzero?
|
24
|
-
increment(engine
|
24
|
+
increment(engine, "result.error")
|
25
25
|
else
|
26
|
-
increment(engine
|
26
|
+
increment(engine, "result.success")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -31,14 +31,20 @@ module CC
|
|
31
31
|
|
32
32
|
attr_reader :statsd
|
33
33
|
|
34
|
-
def increment(
|
34
|
+
def increment(engine, metric)
|
35
35
|
statsd.increment("engines.#{metric}")
|
36
|
-
statsd.increment("engines.names.#{name}.#{metric}")
|
36
|
+
statsd.increment("engines.names.#{engine.name}.#{metric}")
|
37
|
+
if engine.respond_to?(:channel) && engine.channel
|
38
|
+
statsd.increment("engines.names.#{engine.name}.#{engine.channel}.#{metric}")
|
39
|
+
end
|
37
40
|
end
|
38
41
|
|
39
|
-
def timing(
|
42
|
+
def timing(engine, metric, ms)
|
40
43
|
statsd.timing("engines.#{metric}", ms)
|
41
|
-
statsd.timing("engines.names.#{name}.#{metric}", ms)
|
44
|
+
statsd.timing("engines.names.#{engine.name}.#{metric}", ms)
|
45
|
+
if engine.respond_to?(:channel) && engine.channel
|
46
|
+
statsd.timing("engines.names.#{engine.name}.#{engine.channel}.#{metric}", ms)
|
47
|
+
end
|
42
48
|
end
|
43
49
|
end
|
44
50
|
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.
|
4
|
+
version: 0.74.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
271
|
version: '0'
|
272
272
|
requirements: []
|
273
273
|
rubyforge_project:
|
274
|
-
rubygems_version: 2.
|
274
|
+
rubygems_version: 2.4.5
|
275
275
|
signing_key:
|
276
276
|
specification_version: 4
|
277
277
|
summary: Code Climate CLI
|