perf_check 0.5.5 → 0.6.0
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 +0 -2
- data/lib/perf_check/config.rb +8 -12
- data/lib/perf_check/output.rb +0 -43
- data/lib/perf_check/test_case.rb +4 -4
- data/lib/perf_check.rb +0 -1
- 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: 4889da43eb0fdd05ddda82e2ac5ce98f39fa2104
|
4
|
+
data.tar.gz: 37f15e1100fbdb95b386921da50a2be65a4daec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded87cf9dd12de4ebd09d4305008ccfc7a9111e61cd51ff682da0cee52f5c97912382ead9a87832c1c86fe069f1c850893be4270e8533733e4c6602e47be66de
|
7
|
+
data.tar.gz: 9d0960078d6740851e1c79f8d577a137b733a3c08d22c6d5c690a56540dfa3eb3bdf56289e71b149fa937de19280f9df7f81e42993ba1fba391049bc0921adc3
|
data/bin/perf_check
CHANGED
data/lib/perf_check/config.rb
CHANGED
@@ -47,10 +47,6 @@ class PerfCheck
|
|
47
47
|
options.headers[key.strip] = value.strip
|
48
48
|
end
|
49
49
|
|
50
|
-
opts.on('--json', '-j') do
|
51
|
-
options.json = true
|
52
|
-
end
|
53
|
-
|
54
50
|
opts.on('--input FILE', '-i') do |input|
|
55
51
|
File.readlines(input).each do |resource|
|
56
52
|
ARGV << resource.strip
|
@@ -66,12 +62,12 @@ class PerfCheck
|
|
66
62
|
options.brief = true
|
67
63
|
end
|
68
64
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
65
|
+
opts.on('--diff') do
|
66
|
+
options.diff = true
|
67
|
+
options.brief = true
|
68
|
+
options.verify_responses = true
|
69
|
+
options.number_of_requests = 1
|
70
|
+
end
|
75
71
|
|
76
72
|
opts.separator ''
|
77
73
|
opts.separator <<EOF
|
@@ -101,8 +97,8 @@ EOF
|
|
101
97
|
end
|
102
98
|
end
|
103
99
|
|
104
|
-
def
|
105
|
-
|
100
|
+
def diff_options
|
101
|
+
@diff_options ||=
|
106
102
|
['-U3', '--ignore-matching-lines=/mini-profiler-resources/includes.js']
|
107
103
|
end
|
108
104
|
end
|
data/lib/perf_check/output.rb
CHANGED
@@ -66,47 +66,4 @@ class PerfCheck
|
|
66
66
|
print_diff_results(test.response_diff) if options.verify_responses
|
67
67
|
end
|
68
68
|
end
|
69
|
-
|
70
|
-
def print_json_results
|
71
|
-
results = []
|
72
|
-
test_cases.each do |test|
|
73
|
-
results.push(
|
74
|
-
route: test.resource,
|
75
|
-
latency: test.this_latency,
|
76
|
-
query_count: test.this_query_count,
|
77
|
-
requests: []
|
78
|
-
)
|
79
|
-
|
80
|
-
test.this_profiles.each do |profile|
|
81
|
-
results[-1][:requests].push(
|
82
|
-
latency: profile.latency,
|
83
|
-
query_count: profile.query_count,
|
84
|
-
server_memory: profile.server_memory,
|
85
|
-
response_code: profile.response_code,
|
86
|
-
miniprofiler_url: profile.profile_url
|
87
|
-
)
|
88
|
-
end
|
89
|
-
|
90
|
-
if options.reference
|
91
|
-
results[-1].merge!(
|
92
|
-
reference_latency: test.reference_latency,
|
93
|
-
latency_difference: test.latency_difference,
|
94
|
-
speedup_factor: test.speedup_factor,
|
95
|
-
reference_query_count: test.reference_query_count,
|
96
|
-
reference_requests: []
|
97
|
-
)
|
98
|
-
|
99
|
-
test.reference_profiles.each do |profile|
|
100
|
-
results[-1][:reference_requests].push(
|
101
|
-
latency: profile.latency,
|
102
|
-
query_count: profile.query_count,
|
103
|
-
server_memory: profile.server_memory,
|
104
|
-
response_code: profile.response_code,
|
105
|
-
miniprofiler_url: profile.profile_url
|
106
|
-
)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
puts JSON.pretty_generate(results)
|
111
|
-
end
|
112
69
|
end
|
data/lib/perf_check/test_case.rb
CHANGED
@@ -80,13 +80,13 @@ class PerfCheck
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def response_diff
|
83
|
-
diff = Diffy::Diff.new(
|
84
|
-
:
|
83
|
+
diff = Diffy::Diff.new(reference_response, this_response,
|
84
|
+
diff: perf_check.diff_options)
|
85
85
|
if diff.to_s.empty?
|
86
86
|
OpenStruct.new(:changed? => false)
|
87
87
|
else
|
88
|
-
FileUtils.mkdir_p("#{
|
89
|
-
file = `mktemp -u "#{
|
88
|
+
FileUtils.mkdir_p("#{perf_check.app_root}/tmp/perf_check/diffs")
|
89
|
+
file = `mktemp -u "#{perf_check.app_root}/tmp/perf_check/diffs/XXXXXXXXX"`.strip
|
90
90
|
[:text, :html].each do |format|
|
91
91
|
ext = {:text => 'diff', :html => 'html'}[format]
|
92
92
|
File.open("#{file}.#{ext}", 'w'){ |f| f.write(diff.to_s(format)) }
|
data/lib/perf_check.rb
CHANGED