celluloid-benchmark 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -17
- data/lib/celluloid_benchmark/version.rb +1 -1
- data/lib/celluloid_benchmark/visitor.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3105edf2d26ae83709428cbf424c160af85ac873
|
4
|
+
data.tar.gz: fbcf9dcc2dee0f079de95314c773e2c7dda1e454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af74a8ace3b69a92d149bdd89b01b722678fb20901a59429584ae116205ee090cf076a758c5e69790ffce18bcc331384682d17cec6b386016d4f08ea5509bb0d
|
7
|
+
data.tar.gz: 1457f4a987f22e5d6b427d577bfec1277ed0a576ba70205ef957d499d02f02a134d36d81cdd45bac4c173d51f74dbe0c7e920249807cd7ba49a9141e492ae1e2
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Celluloid Benchmark realistically load tests websites.
|
2
2
|
|
3
|
-
Write expressive, concise load tests in Ruby. Use [Rubinius](http://rubini.us) and [Celluloid](https://github.com/celluloid/celluloid)
|
3
|
+
Write expressive, concise load tests in Ruby. Use [Rubinius](http://rubini.us) and [Celluloid](https://github.com/celluloid/celluloid)
|
4
4
|
for high concurrency. Use [Mechanize](http://mechanize.rubyforge.org) for a realistic (albeit non-JavaScript) browser client.
|
5
5
|
|
6
6
|
Getting Started
|
@@ -19,7 +19,7 @@ Simple scenario
|
|
19
19
|
benchmark :home_page, 1
|
20
20
|
get "https://github.com/scottwillson/celluloid-benchmark"
|
21
21
|
|
22
|
-
`benchmark :label, duration` means "measure the following requests and group them under 'label'".
|
22
|
+
`benchmark :label, duration` means "measure the following requests and group them under 'label'".
|
23
23
|
Duration is optional and defaults to 0.3 seconds.
|
24
24
|
|
25
25
|
Find and click a link
|
@@ -52,7 +52,7 @@ Simulate AJAX
|
|
52
52
|
|
53
53
|
Test data
|
54
54
|
---------
|
55
|
-
Because test scenarios are plain Ruby, you can drive tests in many different ways. The
|
55
|
+
Because test scenarios are plain Ruby, you can drive tests in many different ways. The
|
56
56
|
[Faker gem](http://rubydoc.info/github/stympy/faker/master/frames) is handy
|
57
57
|
for random, realistic test data:
|
58
58
|
|
@@ -72,7 +72,7 @@ Celluloid Benchmark can also pull random test data from CSV files. For example:
|
|
72
72
|
|
73
73
|
`random_data(:post_zone)` pulls a random line from tmp/data/post_zones.csv
|
74
74
|
|
75
|
-
Celluloid Benchmark agents delegate calls to Mechanize. If you need something more complicated
|
75
|
+
Celluloid Benchmark agents delegate calls to Mechanize. If you need something more complicated
|
76
76
|
than the examples, check out the [Mechanize API](http://mechanize.rubyforge.org/HTTP/Agent.html) and call it directly with `browser.` in your test scenario.
|
77
77
|
|
78
78
|
For a longer test, pass in a second duration argument (seconds):
|
@@ -81,11 +81,11 @@ For a longer test, pass in a second duration argument (seconds):
|
|
81
81
|
Why
|
82
82
|
===
|
83
83
|
I need to simulate a lot of realistic traffic against preproduction code.
|
84
|
-
There are many good tools that can put a high load on a static URL (e.g., [ab](http://httpd.apache.org/docs/2.2/programs/ab.html)), and there are a few tools
|
85
|
-
(e.g., [Tsung](http://tsung.erlang-projects.org)) that can generate realistic multiple-URL loads. By "realistic" I mean: follow links, maintain
|
86
|
-
session state from one page to the next, simulate different types of simultaneous visitors (5% admin users + 10%
|
87
|
-
business customers + 75% consumers). I found it difficult to maintain complex scenarios. Our Tsung tests,
|
88
|
-
for instance, exploded into many ERB files that concatenated into a giant Tsung XML config (with some custom Erlang
|
84
|
+
There are many good tools that can put a high load on a static URL (e.g., [ab](http://httpd.apache.org/docs/2.2/programs/ab.html)), and there are a few tools
|
85
|
+
(e.g., [Tsung](http://tsung.erlang-projects.org)) that can generate realistic multiple-URL loads. By "realistic" I mean: follow links, maintain
|
86
|
+
session state from one page to the next, simulate different types of simultaneous visitors (5% admin users + 10%
|
87
|
+
business customers + 75% consumers). I found it difficult to maintain complex scenarios. Our Tsung tests,
|
88
|
+
for instance, exploded into many ERB files that concatenated into a giant Tsung XML config (with some custom Erlang
|
89
89
|
functions). I also wanted control over recording and displaying test results.
|
90
90
|
|
91
91
|
Wouldn't it be nice to just write Ruby?
|
@@ -94,7 +94,7 @@ Yes, expect for that Ruby GIL issue. Which led me to Rubinius and Celluloid.
|
|
94
94
|
|
95
95
|
Rubinius is a concurrency-friendly implementation of Ruby, and Celluloid is a nice Ruby actor framework.
|
96
96
|
|
97
|
-
Celluloid also works with MRI 1.9 and 2.0, though Celluloid Benchmark can generate more concurrent load with
|
97
|
+
Celluloid also works with MRI 1.9 and 2.0, though Celluloid Benchmark can generate more concurrent load with
|
98
98
|
Rubinius. [JRuby](http://jruby.org) should also work well, maybe better.
|
99
99
|
|
100
100
|
I've just added features I need, but it should be easy to add more. For example:
|
@@ -107,20 +107,20 @@ Alternatives
|
|
107
107
|
|
108
108
|
Simple
|
109
109
|
------
|
110
|
-
[ab (Apache Bench)](http://httpd.apache.org/docs/2.2/programs/ab.html)
|
110
|
+
[ab (Apache Bench)](http://httpd.apache.org/docs/2.2/programs/ab.html)
|
111
111
|
|
112
|
-
[httperf](http://www.hpl.hp.com/research/linux/httperf/)
|
112
|
+
[httperf](http://www.hpl.hp.com/research/linux/httperf/)
|
113
113
|
|
114
|
-
[siege](http://freecode.com/projects/siege)
|
114
|
+
[siege](http://freecode.com/projects/siege)
|
115
115
|
|
116
116
|
|
117
117
|
Complex
|
118
118
|
-------
|
119
|
-
[Tsung](http://tsung.erlang-projects.org)
|
119
|
+
[Tsung](http://tsung.erlang-projects.org)
|
120
120
|
|
121
|
-
[The Grinder](http://grinder.sourceforge.net)
|
121
|
+
[The Grinder](http://grinder.sourceforge.net)
|
122
122
|
|
123
|
-
[JMeter](http://jmeter.apache.org)
|
123
|
+
[JMeter](http://jmeter.apache.org)
|
124
124
|
|
125
125
|
|
126
126
|
Develop
|
@@ -137,4 +137,7 @@ Develop
|
|
137
137
|
CI
|
138
138
|
==
|
139
139
|
https://travis-ci.org/scottwillson/celluloid-benchmark
|
140
|
-
|
140
|
+
|
141
|
+
|
142
|
+
[](https://travis-ci.org/scottwillson/celluloid-benchmark)
|
143
|
+
[](https://codeclimate.com/github/scottwillson/celluloid-benchmark)
|
@@ -22,6 +22,7 @@ module CelluloidBenchmark
|
|
22
22
|
def initialize(browser = Mechanize.new)
|
23
23
|
@browser = browser
|
24
24
|
add_browser_timing_hooks
|
25
|
+
browser.user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"
|
25
26
|
end
|
26
27
|
|
27
28
|
def run_session(session, benchmark_run, duration)
|
@@ -46,6 +47,15 @@ module CelluloidBenchmark
|
|
46
47
|
self.current_request_threshold = threshold
|
47
48
|
end
|
48
49
|
|
50
|
+
def browser_type(value)
|
51
|
+
case value
|
52
|
+
when :iphone
|
53
|
+
browser.user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"
|
54
|
+
else
|
55
|
+
browser.user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
49
59
|
|
50
60
|
private
|
51
61
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid-benchmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Willson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-15 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: celluloid
|