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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 87720f2516d4a0520ec7d0bbe26f0194f1e3c4ca659a1477040626800e702fb1
4
- data.tar.gz: 5de7992bcf2be1ba68b4b06f02b6eb77aee200f0e499097483e31080af6b19b1
2
+ SHA1:
3
+ metadata.gz: 34ac95420d3727f08da87c7eaee9385ca4bbdc28
4
+ data.tar.gz: 1020c9604094e1e3fec237218f5ecd95ef9650a9
5
5
  SHA512:
6
- metadata.gz: 66c25e698f3b1e54a3b4539f2a90f599963de4f09c119d74d2af255c9f252bdd748a6c333232805ab6151e3971c35d98386f44f920f668bff3961b1287229963
7
- data.tar.gz: 9cf5cec6b380885b74c141afc2fa35a411e60df70542888d059e364c77d4bfe48cf84bc07cbe251a0876fe865935c4ea14817ffa87f4c1bc22224bd4bb63db05
6
+ metadata.gz: 90311c1e55a6923cf0af2e33c942e41090427a7f9690399fe52057d93f862cc8654c95ccc8863a75474baaa43b03ae032ea9819a87a028310f44da893f816d9e
7
+ data.tar.gz: 6118ab05a82a09e5c351b5916d14ee20a48f6d6a3176bc5ca4bc1a56fde12c2b44743003bd1cc7b4755e0ef563c805f47cde17e0aff2f939d8f5092ec2dafcd3
@@ -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.name, "started")
9
+ increment(engine, "started")
10
10
  end
11
11
 
12
12
  def finished(engine, _details, result)
13
- timing(engine.name, "time", result.duration)
14
- increment(engine.name, "finished")
13
+ timing(engine, "time", result.duration)
14
+ increment(engine, "finished")
15
15
 
16
16
  if result.timed_out?
17
- timing(engine.name, "time", result.duration)
18
- increment(engine.name, "result.error")
19
- increment(engine.name, "result.error.timeout")
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.name, "result.error")
22
- increment(engine.name, "result.error.output_exceeded")
21
+ increment(engine, "result.error")
22
+ increment(engine, "result.error.output_exceeded")
23
23
  elsif result.exit_status.nonzero?
24
- increment(engine.name, "result.error")
24
+ increment(engine, "result.error")
25
25
  else
26
- increment(engine.name, "result.success")
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(name, metric)
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(name, metric, ms)
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.73.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-08 00:00:00.000000000 Z
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.7.7
274
+ rubygems_version: 2.4.5
275
275
  signing_key:
276
276
  specification_version: 4
277
277
  summary: Code Climate CLI