perf_check 0.1.7 → 0.1.8
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 +2 -0
- data/lib/perf_check/test_case.rb +1 -0
- data/lib/perf_check.rb +16 -0
- 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: 939ed2568e6f37048787e9548970ebf399344133
|
4
|
+
data.tar.gz: 20ba90e0a2186d797ad4bbffe67c06292e89b53f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85f978097f52963d7a370baf0c81c18988d3eb6f3f365158f4719080d4da39ced9ec4e953d1728621922880ba4b2a45a3fbfe40e50dee545e4e6a941746b615b
|
7
|
+
data.tar.gz: 2897e7dae4cc2db59c22f926b2bf88616770f8bba043987dfde4ef260b665437ca6c1708ff05688c1474c48488c7976f6d71cf1b398bc16ee7a8b827aa2125bd
|
data/bin/perf_check
CHANGED
data/lib/perf_check/test_case.rb
CHANGED
data/lib/perf_check.rb
CHANGED
@@ -37,6 +37,14 @@ class PerfCheck
|
|
37
37
|
require "#{app_root}/config/environment"
|
38
38
|
end
|
39
39
|
|
40
|
+
def self.when_finished(&block)
|
41
|
+
@when_finished_callback = block
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.callback
|
45
|
+
@when_finished_callback
|
46
|
+
end
|
47
|
+
|
40
48
|
def initialize
|
41
49
|
self.options = OpenStruct.new
|
42
50
|
self.server = Server.new
|
@@ -89,6 +97,14 @@ class PerfCheck
|
|
89
97
|
end
|
90
98
|
end
|
91
99
|
|
100
|
+
def trigger_callback
|
101
|
+
results = OpenStruct.new(:current_branch => PerfCheck::Git.current_branch)
|
102
|
+
if test_cases.size == 1
|
103
|
+
results.current_latency = test_cases.first.this_latency
|
104
|
+
results.reference_latency = test_cases.first.reference_latency
|
105
|
+
end
|
106
|
+
PerfCheck.callback.call(results)
|
107
|
+
end
|
92
108
|
|
93
109
|
def print_diff_results(diff)
|
94
110
|
if diff.changed?
|