perf_check 0.10.3 → 0.10.4

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/perf_check/test_case.rb +12 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f56f0b0743b114ba97c7cf95a7a4e6c955aab1ee52089e55ceaa4766b6e45ff2
4
- data.tar.gz: 734a1b4023df42c4c5892bdb3f1ea806088179f182f191f5cc920ac265e90199
3
+ metadata.gz: 2e073e79c2756b326a86eb0770eb86820d121c75f590b58948fe30481a5bedec
4
+ data.tar.gz: 9da6ab0dcf5dd4e222d112ff3490cbdf7eec84e885d7203a0aab403e5a5160f4
5
5
  SHA512:
6
- metadata.gz: da95a54d9480b7017b428c39d891a171656ec5a441410387fce03ddf06b6781bc069c02afbad1d2517aee2a6de39da15dd68b35322116703069abeb45e978ca5
7
- data.tar.gz: 9e32ddf4449aeb1703c97e9520e993216f8da0c3f02ab3eaa605d2fc6910af52d524043f739d1567e85eb5e1b1b53fee8fb5182fef5d4cf029ce7080341ea0e3
6
+ metadata.gz: 95ef058469bd7891b3d6dbf7adfa4abc639f641187ad0304b601f8d2d8012ffd8f1d527accb865d3673fe41e8123fb049737334bbe0693d53e7df0d13cae44cd
7
+ data.tar.gz: bd350af6ac0645043b5169950fd7d24812ddb66cd536f8126f733300ec7e891971364da9eb2b5c2763945e4e8907888b1173205f10269ff82f448ab79c14bc2b
@@ -8,6 +8,7 @@ class PerfCheck
8
8
  attr_accessor :resource
9
9
  attr_accessor :cookie, :this_response, :reference_response
10
10
  attr_accessor :this_profiles, :reference_profiles
11
+ attr_accessor :http_status, :max_memory, :error_backtrace
11
12
 
12
13
  def initialize(perf_check, route)
13
14
  @perf_check = perf_check
@@ -34,17 +35,27 @@ class PerfCheck
34
35
  i, profile.latency, profile.server_memory,
35
36
  profile.response_code, profile.query_count, profile.profile_url)
36
37
  perf_check.logger.info(row)
38
+ self.max_memory = profile.server_memory
37
39
  end
38
40
 
39
41
  context_profiles << profile
42
+
43
+ self.http_status = '200'
44
+
40
45
  unless options.http_statuses.include?(profile.response_code)
46
+ self.http_status = profile.response_code
47
+
41
48
  error = sprintf("\t :\tFAILED! (HTTP %d)", profile.response_code)
42
49
  perf_check.logger.warn(error.red.bold)
43
50
  perf_check.logger.warn("\t The server responded with an invalid http code")
44
51
  if profile.backtrace
45
52
  perf_check.logger.warn("Backtrace found:")
46
53
  backtrace = [profile.backtrace[0], *profile.backtrace.grep(/#{perf_check.app_root}/)]
47
- backtrace.each{ |line| perf_check.logger.warn(" #{line}") }
54
+ self.error_backtrace = ''
55
+ backtrace.each do |line|
56
+ perf_check.logger.warn(" #{line}")
57
+ self.error_backtrace += "#{line}\n"
58
+ end
48
59
  end
49
60
  break
50
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perf_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - rubytune
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-01 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec