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.
- checksums.yaml +4 -4
- data/bin/perf_check +27 -17
- data/lib/perf_check.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7c7989efce0b4fe016b7dbf93b7ee720f93f696
|
4
|
+
data.tar.gz: 51da3386fddcdb81f6ba1855c24a8b8a78c40d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
123
|
+
begin
|
124
|
+
opts.parse!
|
125
125
|
|
126
|
-
|
127
|
-
perf_check.add_test_case(route)
|
128
|
-
end
|
126
|
+
PerfCheck.require_rails(options)
|
129
127
|
|
130
|
-
|
131
|
-
|
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
|
-
|
141
|
-
else
|
142
|
-
|
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
|
-
|
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
|