benchy 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +36 -0
- data/lib/benchy.rb +3 -4
- data/lib/benchy/version.rb +1 -1
- metadata +6 -5
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Benchy
|
2
|
+
|
3
|
+
I wrote this one day because I was trying to test upload performance and no tools out there were cutting it. You can do sane stuff like:
|
4
|
+
|
5
|
+
```
|
6
|
+
benchy post http://127.0.0.1:8080/ -c 10 < my_pic.jpg # Simulates 10 concurrent HTTP POST requests
|
7
|
+
```
|
8
|
+
|
9
|
+
or
|
10
|
+
|
11
|
+
```
|
12
|
+
benchy get http://127.0.0.1:8080/ # Just run a bunch of GET requests at a concurrency of 1
|
13
|
+
```
|
14
|
+
|
15
|
+
and it runs indefintely until you kill the process.
|
16
|
+
|
17
|
+
# Getting Started
|
18
|
+
|
19
|
+
Install benchie:
|
20
|
+
|
21
|
+
```
|
22
|
+
gem install benchy
|
23
|
+
```
|
24
|
+
|
25
|
+
Then run a command! As you'd expect:
|
26
|
+
|
27
|
+
```
|
28
|
+
$ benchy help
|
29
|
+
Tasks:
|
30
|
+
benchy delete URL # Perform DELETE requests against a URL
|
31
|
+
benchy get URL # Perform GET requests against a URL
|
32
|
+
benchy head URL # Perform HEAD requests against a URL
|
33
|
+
benchy help [TASK] # Describe available tasks or one specific task
|
34
|
+
benchy post URL # Perform POST requests to a URL
|
35
|
+
benchy put URL # Perform PUT requests to a URL
|
36
|
+
```
|
data/lib/benchy.rb
CHANGED
@@ -23,7 +23,7 @@ module Benchy
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def workers
|
26
|
-
@workers ||= (0
|
26
|
+
@workers ||= (0...concurrency).map{|n| Worker.new(request, "worker.#{n}") }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -80,7 +80,7 @@ module Benchy
|
|
80
80
|
# Parse out some command line goodness
|
81
81
|
class CLI < Thor
|
82
82
|
%w[post put].each do |meth|
|
83
|
-
desc "#{meth} URL", "#{meth.upcase} to a URL"
|
83
|
+
desc "#{meth} URL", "Perform #{meth.upcase} requests to a URL"
|
84
84
|
method_option :body,
|
85
85
|
:type => :string,
|
86
86
|
:aliases => '-b',
|
@@ -104,13 +104,12 @@ module Benchy
|
|
104
104
|
end
|
105
105
|
|
106
106
|
%w[get head delete].each do |meth|
|
107
|
-
desc "#{meth} URL", "#{meth.upcase}
|
107
|
+
desc "#{meth} URL", "Perform #{meth.upcase} requests against a URL"
|
108
108
|
method_option :headers,
|
109
109
|
:type => :hash,
|
110
110
|
:aliases => '-h',
|
111
111
|
:desc => 'Request headers',
|
112
112
|
:default => {
|
113
|
-
'Content-Type' => 'application/binary-octet',
|
114
113
|
'Accepts' => '*/*'
|
115
114
|
}
|
116
115
|
method_option :concurrency,
|
data/lib/benchy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: em-http-request
|
16
|
-
requirement: &
|
16
|
+
requirement: &70113639412860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70113639412860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: thor
|
27
|
-
requirement: &
|
27
|
+
requirement: &70113639412440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70113639412440
|
36
36
|
description: A dirty-simple HTTP benchmarking application
|
37
37
|
email:
|
38
38
|
- brad@bradgessler.com
|
@@ -43,6 +43,7 @@ extra_rdoc_files: []
|
|
43
43
|
files:
|
44
44
|
- .gitignore
|
45
45
|
- Gemfile
|
46
|
+
- README.md
|
46
47
|
- Rakefile
|
47
48
|
- benchy.gemspec
|
48
49
|
- bin/benchy
|