perf_check 0.1.9 → 0.1.10
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 +3 -1
- data/lib/perf_check.rb +16 -4
- 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: e6092360e95a8950b156ebc6790148b00b68f2b8
|
4
|
+
data.tar.gz: 98cd004e57313a8fd77e42e21ca05c4a9b538d3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d36b10cc1a65320df58884ecdec5d832567cc664f5d091f88498ec10eec0e5a5477f2c9a50b1dbf074e577d84832e2bae89da0478b04b5b26237d36109e541b4
|
7
|
+
data.tar.gz: 7ee8ad0ee7ccb9209315fcc5930e3c11af9ed05781508e640c8ece3ebe45220f6014c0f471f8d20fec26e947f240e8778aa8374b53a4295cbba4fa0d5d65a400
|
data/bin/perf_check
CHANGED
@@ -131,6 +131,8 @@ if perf_check.test_cases.empty?
|
|
131
131
|
abort(opts.help)
|
132
132
|
end
|
133
133
|
|
134
|
+
perf_check.trigger_before_start_callback
|
135
|
+
|
134
136
|
perf_check.sanity_check
|
135
137
|
perf_check.run
|
136
138
|
|
@@ -140,7 +142,7 @@ else
|
|
140
142
|
perf_check.print_results
|
141
143
|
end
|
142
144
|
|
143
|
-
perf_check.
|
145
|
+
perf_check.trigger_when_finished_callback
|
144
146
|
|
145
147
|
# _______________________
|
146
148
|
# < You made it faster!!! >
|
data/lib/perf_check.rb
CHANGED
@@ -41,8 +41,16 @@ class PerfCheck
|
|
41
41
|
@when_finished_callback = block
|
42
42
|
end
|
43
43
|
|
44
|
-
def self.
|
45
|
-
@when_finished_callback
|
44
|
+
def self.when_finished_callback
|
45
|
+
@when_finished_callback || proc{ |*args| }
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.before_start(&block)
|
49
|
+
@before_start = block
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.before_start_callback
|
53
|
+
@before_start_callback || proc{ |*args| }
|
46
54
|
end
|
47
55
|
|
48
56
|
def initialize
|
@@ -97,14 +105,18 @@ class PerfCheck
|
|
97
105
|
end
|
98
106
|
end
|
99
107
|
|
100
|
-
def
|
108
|
+
def trigger_before_start_callback
|
109
|
+
PerfCheck.before_start_callback.call(self)
|
110
|
+
end
|
111
|
+
|
112
|
+
def trigger_when_finished_callback
|
101
113
|
results = OpenStruct.new(:current_branch => PerfCheck::Git.current_branch)
|
102
114
|
results[:ARGV] = ORIGINAL_ARGV
|
103
115
|
if test_cases.size == 1
|
104
116
|
results.current_latency = test_cases.first.this_latency
|
105
117
|
results.reference_latency = test_cases.first.reference_latency
|
106
118
|
end
|
107
|
-
PerfCheck.
|
119
|
+
PerfCheck.when_finished_callback.call(results)
|
108
120
|
end
|
109
121
|
|
110
122
|
def print_diff_results(diff)
|