codeclimate 0.35.0 → 0.35.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cc/analyzer/container.rb +12 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fc6f49738750affec64ab80ccf8307efec1b9d2
4
- data.tar.gz: f1f7e789e916727190cc0059761f50640a2b955f
3
+ metadata.gz: 6a645991c744635df303a345f6a2e82d0fdbe355
4
+ data.tar.gz: f9ee567049514596fb20c7e28c2cc7a9e24ff7c1
5
5
  SHA512:
6
- metadata.gz: 56e5a24c670d7ea80026c73e21ebc7afb4518760a3951bb3256b5eeb3265ced74d24f0323421849d26640355bbf8ad7859dca1fc936f6ea2caf7140aba0a96ca
7
- data.tar.gz: cce1f4745d9b8a85e556ba66cdefef80c1fca52abcb735c61b194866359de988e77276c63a9cb544fd7fc000e191f97c82597a53836ec6229f9cff37e41241bd
6
+ metadata.gz: 43ded224e244ecac15204adbb16adfe4811c8601c99e336f52dd0d3c84a3196cf76c03e5384521cb959757206f9f28f0d6c8f6e5401bae117e9b93aef8ff9bac
7
+ data.tar.gz: 5d7a6c904e5b7e44ccb9b6f24ee0bac6b0b841f10995490aa79cc1b4a2df54b5a9f6a0f03eded487f13421e90b734577188966a71c8023cf5f957b939523de6e
@@ -174,6 +174,10 @@ module CC
174
174
  Analyzer.logger.warn("killing container name=#{@name} message=#{message.inspect}")
175
175
  POSIX::Spawn::Child.new("docker", "kill", @name, timeout: 2.minutes)
176
176
  POSIX::Spawn::Child.new("docker", "wait", @name, timeout: 2.minutes)
177
+ rescue POSIX::Spawn::TimeoutExceeded
178
+ Analyzer.logger.error("unable to kill container name=#{@name} message=#{message.inspect}")
179
+ Analyzer.statsd.increment("container.zombie")
180
+ Analyzer.statsd.increment("container.zombie.#{metric_name}") if metric_name
177
181
  end
178
182
 
179
183
  def timeout
@@ -183,6 +187,14 @@ module CC
183
187
  def maximum_output_bytes
184
188
  ENV.fetch("CONTAINER_MAXIMUM_OUTPUT_BYTES", DEFAULT_MAXIMUM_OUTPUT_BYTES).to_i
185
189
  end
190
+
191
+ def metric_name
192
+ if /^cc-engines-(?<engine>[^-]+)-(?<channel>[^-]+)-/ =~ @name
193
+ "engine.#{engine}.#{channel}"
194
+ elsif /^builder-(?<action>[^-]+)-/ =~ @name
195
+ "builder.#{action}"
196
+ end
197
+ end
186
198
  end
187
199
  end
188
200
  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.35.0
4
+ version: 0.35.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-28 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport