perf_check 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/perf_check +27 -17
  3. data/lib/perf_check.rb +3 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 375ae1f634a3b4292d22e8e134ac220548d8139f
4
- data.tar.gz: b95a4fbaa877b73a1585b9c71f84921330b6dcf7
3
+ metadata.gz: d7c7989efce0b4fe016b7dbf93b7ee720f93f696
4
+ data.tar.gz: 51da3386fddcdb81f6ba1855c24a8b8a78c40d44
5
5
  SHA512:
6
- metadata.gz: ee2c14269efc0e0eecc654d4018aa0d4efc368eb143c6d2aba9a5c357727c4f9b3d9a46600128e553e13b2e46009664a31650069ff283b8b9ce61f744b8d48f9
7
- data.tar.gz: 954f2fd46fabe9c583121852e3d73f5e61c4b70c9fb80f97c21524d71da060ee674687421c196028c340f5020ada97eff460d91ccc10e18b2dd30a72fda011b3
6
+ metadata.gz: 90efe1b162da1f88c4b84d6ff5d624e43ced0b4dd1c871c0900bd93cc98f821a3d51c0d530f78cb512a83555f10b499f382b973b78f0496b356ccf89e96b9f10
7
+ data.tar.gz: 46ceccb3a17bcb6ee0d9dd62ddf22d0d9512d0c1d0a202ee5d449b7bf5229fff3f72721f215a48032c9ff7a573349f92c26de92f2ff8b538792cf80bbbcd0df0
data/bin/perf_check CHANGED
@@ -119,31 +119,41 @@ Usage examples:
119
119
  perf_check --diff --input FILE
120
120
  EOF
121
121
  end
122
- opts.parse!
123
122
 
124
- PerfCheck.require_rails(options)
123
+ begin
124
+ opts.parse!
125
125
 
126
- ARGV.each do |route|
127
- perf_check.add_test_case(route)
128
- end
126
+ PerfCheck.require_rails(options)
129
127
 
130
- if perf_check.test_cases.empty?
131
- abort(opts.help)
132
- end
128
+ ARGV.each do |route|
129
+ perf_check.add_test_case(route)
130
+ end
131
+
132
+ if perf_check.test_cases.empty?
133
+ abort(opts.help)
134
+ end
133
135
 
134
- perf_check.trigger_before_start_callback
136
+ perf_check.trigger_before_start_callback
135
137
 
136
- perf_check.sanity_check
137
- perf_check.run
138
+ perf_check.sanity_check
139
+ perf_check.run
138
140
 
139
- if options.brief
140
- perf_check.print_brief_results
141
- else
142
- perf_check.print_results
141
+ if options.brief
142
+ perf_check.print_brief_results
143
+ else
144
+ perf_check.print_results
145
+ end
146
+ rescue error
147
+ ensure
148
+ cbdata = {}
149
+ if error
150
+ cbdata[:error_message] = "#{error.class}: #{error.message}\n"
151
+ cbdata[:error_message] << error.backtrace.map{|x| "\t#{x}"}.join("\n")
152
+ end
153
+ perf_check.trigger_when_finished_callback(dbdata)
154
+ raise error if error
143
155
  end
144
156
 
145
- perf_check.trigger_when_finished_callback
146
-
147
157
  # _______________________
148
158
  # < You made it faster!!! >
149
159
  # -----------------------
data/lib/perf_check.rb CHANGED
@@ -109,8 +109,9 @@ class PerfCheck
109
109
  PerfCheck.before_start_callback.call(self)
110
110
  end
111
111
 
112
- def trigger_when_finished_callback
113
- results = OpenStruct.new(:current_branch => PerfCheck::Git.current_branch)
112
+ def trigger_when_finished_callback(data={})
113
+ data = data.merge(:current_branch => PerfCheck::Git.current_branch)
114
+ results = OpenStruct.new(data)
114
115
  results[:ARGV] = ORIGINAL_ARGV
115
116
  if test_cases.size == 1
116
117
  results.current_latency = test_cases.first.this_latency
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perf_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - rubytune