celluloid-benchmark 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6046d943d61a24402d8b83c8d2d62e4e49c90a15
4
- data.tar.gz: eeb6a22f1182a3b7dad35ed9f77caf6798535441
3
+ metadata.gz: 3105edf2d26ae83709428cbf424c160af85ac873
4
+ data.tar.gz: fbcf9dcc2dee0f079de95314c773e2c7dda1e454
5
5
  SHA512:
6
- metadata.gz: 2bf7cadab5fceaa9d674968641cfa488c27050dea7da25af91b59c583c1d502b4c0ecf4e54b9905f00deb8486e170e1e6c22cbb2e64f4d84924c82b6762fe272
7
- data.tar.gz: 431db7bec3237ad3a9343e99a68b77e8b9765eadf59e858dda99d27ca1cbe479e83e879ff815687a2373b385bec1b4ee0d0daa2bcd3e11dfc03b77731aa4aec7
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
+ [![Build Status](https://travis-ci.org/scottwillson/celluloid-benchmark.svg?branch=master)](https://travis-ci.org/scottwillson/celluloid-benchmark)
143
+ [![Code Climate](https://codeclimate.com/github/scottwillson/celluloid-benchmark.png)](https://codeclimate.com/github/scottwillson/celluloid-benchmark)
@@ -1,3 +1,3 @@
1
1
  module CelluloidBenchmark
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -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.7
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-13 00:00:00 Z
12
+ date: 2014-05-15 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: celluloid