perf_check 0.0.14 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/perf_check/test_case.rb +7 -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: 206189556ad2cf4715e244faceaf080d9b919006
|
4
|
+
data.tar.gz: ccac24e750e16f5096e050b335e0f4dbb9c75a41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57a0025e7c8ee476620b4a4c3f748e79b9cd86c6adb56aad5baed6bed6dcf49001ebd92ca3643d703db1f6082af480c988832380d0593cca71b43bf7982687a1
|
7
|
+
data.tar.gz: 19a85872206132dea420c82f20599619c8f36d6c01f4a2b3155afa92d612c458fcbc17daa72e7a3f026b8976a48838734d729c4f96af26db76a9bb38adaebc97
|
data/lib/perf_check/test_case.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class PerfCheck
|
4
4
|
class TestCase
|
5
|
-
attr_accessor :resource, :controller, :action
|
5
|
+
attr_accessor :resource, :controller, :action, :format
|
6
6
|
attr_accessor :latencies, :cookie
|
7
7
|
attr_accessor :this_latencies, :reference_latencies
|
8
8
|
|
@@ -15,6 +15,7 @@ class PerfCheck
|
|
15
15
|
|
16
16
|
self.controller = params[:controller].split('/')[-1]
|
17
17
|
self.action = params[:action]
|
18
|
+
self.format = params[:format]
|
18
19
|
self.resource = route
|
19
20
|
end
|
20
21
|
|
@@ -24,9 +25,13 @@ class PerfCheck
|
|
24
25
|
print(" "+'server rss'.underline)
|
25
26
|
puts(" "+'profiler data'.underline)
|
26
27
|
|
28
|
+
headers = {'Cookie' => "#{cookie}"}
|
29
|
+
unless self.format
|
30
|
+
headers['Accept'] = 'text/html,application/xhtml+xml,application/xml'
|
31
|
+
end
|
27
32
|
options.number_of_requests.times do |i|
|
28
33
|
profile = server.profile do |http|
|
29
|
-
http.get(resource,
|
34
|
+
http.get(resource, headers)
|
30
35
|
end
|
31
36
|
|
32
37
|
unless options.http_statuses.include? profile.response_code
|