stella 0.5.4 → 0.5.5
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.
- data/README.textile +14 -10
- data/Rakefile +22 -36
- data/lib/daemonize.rb +56 -0
- data/lib/stella/adapter/ab.rb +49 -39
- data/lib/stella/adapter/base.rb +17 -8
- data/lib/stella/adapter/httperf.rb +24 -18
- data/lib/stella/adapter/pcap_watcher.rb +1 -1
- data/lib/stella/adapter/siege.rb +15 -12
- data/lib/stella/cli/localtest.rb +2 -3
- data/lib/stella/cli/sysinfo.rb +0 -1
- data/lib/stella/cli.rb +10 -55
- data/lib/stella/command/base.rb +0 -62
- data/lib/stella/command/localtest.rb +35 -36
- data/lib/stella/data/domain.rb +18 -11
- data/lib/stella/data/http.rb +23 -16
- data/lib/stella/logger.rb +29 -19
- data/lib/stella/response.rb +5 -2
- data/lib/stella/storable.rb +138 -52
- data/lib/stella/support.rb +107 -8
- data/lib/stella/sysinfo.rb +26 -16
- data/lib/stella/test/definition.rb +1 -1
- data/lib/stella/test/run/summary.rb +23 -13
- data/lib/stella/test/stats.rb +114 -0
- data/lib/stella/text/resource.rb +1 -1
- data/lib/stella.rb +29 -4
- data/lib/utils/mathutil.rb +0 -76
- data/lib/utils/stats.rb +88 -0
- data/lib/win32/Console/ANSI.rb +305 -305
- data/lib/win32/Console.rb +970 -970
- data/support/ruby-pcap-takuma-patch.txt +13 -13
- data/support/text/en.yaml +11 -8
- data/support/text/nl.yaml +7 -1
- data/{spec/show-agents_spec.rb → tests/01-util_test.rb} +0 -0
- data/tests/02-stella-util_test.rb +42 -0
- data/tests/10-stella_test.rb +104 -0
- data/tests/11-stella-storable_test.rb +68 -0
- data/tests/60-stella-command_test.rb +248 -0
- data/tests/80-stella-cli_test.rb +45 -0
- data/tests/spec-helper.rb +31 -0
- data/vendor/{frylock/README.textile → drydock/LICENSE.txt} +2 -52
- data/vendor/drydock/README.textile +57 -0
- data/vendor/{frylock → drydock}/bin/example +14 -14
- data/vendor/{frylock/frylock.gemspec → drydock/drydock.gemspec} +1 -1
- data/vendor/{frylock/lib/frylock → drydock/lib/drydock}/exceptions.rb +1 -1
- data/vendor/{frylock/lib/frylock.rb → drydock/lib/drydock.rb} +8 -8
- data/vendor/{frylock → drydock}/test/command_test.rb +0 -0
- metadata +34 -61
- data/lib/stella/test/base.rb +0 -38
- data/lib/stella/test/summary.rb +0 -82
- data/vendor/hitimes-0.4.0/HISTORY +0 -28
- data/vendor/hitimes-0.4.0/LICENSE.txt +0 -19
- data/vendor/hitimes-0.4.0/README +0 -80
- data/vendor/hitimes-0.4.0/Rakefile +0 -63
- data/vendor/hitimes-0.4.0/examples/benchmarks.rb +0 -86
- data/vendor/hitimes-0.4.0/examples/stats.rb +0 -29
- data/vendor/hitimes-0.4.0/ext/extconf.rb +0 -15
- data/vendor/hitimes-0.4.0/ext/hitimes_ext.c +0 -21
- data/vendor/hitimes-0.4.0/ext/hitimes_instant_clock_gettime.c +0 -20
- data/vendor/hitimes-0.4.0/ext/hitimes_instant_osx.c +0 -16
- data/vendor/hitimes-0.4.0/ext/hitimes_instant_windows.c +0 -27
- data/vendor/hitimes-0.4.0/ext/hitimes_interval.c +0 -340
- data/vendor/hitimes-0.4.0/ext/hitimes_interval.h +0 -73
- data/vendor/hitimes-0.4.0/ext/hitimes_stats.c +0 -242
- data/vendor/hitimes-0.4.0/ext/hitimes_stats.h +0 -30
- data/vendor/hitimes-0.4.0/ext/rbconfig-mingw.rb +0 -178
- data/vendor/hitimes-0.4.0/ext/rbconfig.rb +0 -178
- data/vendor/hitimes-0.4.0/gemspec.rb +0 -54
- data/vendor/hitimes-0.4.0/lib/hitimes/mutexed_stats.rb +0 -23
- data/vendor/hitimes-0.4.0/lib/hitimes/paths.rb +0 -54
- data/vendor/hitimes-0.4.0/lib/hitimes/stats.rb +0 -29
- data/vendor/hitimes-0.4.0/lib/hitimes/timer.rb +0 -223
- data/vendor/hitimes-0.4.0/lib/hitimes/version.rb +0 -42
- data/vendor/hitimes-0.4.0/lib/hitimes.rb +0 -24
- data/vendor/hitimes-0.4.0/spec/interval_spec.rb +0 -115
- data/vendor/hitimes-0.4.0/spec/mutex_stats_spec.rb +0 -34
- data/vendor/hitimes-0.4.0/spec/paths_spec.rb +0 -14
- data/vendor/hitimes-0.4.0/spec/spec_helper.rb +0 -6
- data/vendor/hitimes-0.4.0/spec/stats_spec.rb +0 -72
- data/vendor/hitimes-0.4.0/spec/timer_spec.rb +0 -105
- data/vendor/hitimes-0.4.0/spec/version_spec.rb +0 -27
- data/vendor/hitimes-0.4.0/tasks/announce.rake +0 -39
- data/vendor/hitimes-0.4.0/tasks/config.rb +0 -107
- data/vendor/hitimes-0.4.0/tasks/distribution.rake +0 -53
- data/vendor/hitimes-0.4.0/tasks/documentation.rake +0 -33
- data/vendor/hitimes-0.4.0/tasks/extension.rake +0 -64
- data/vendor/hitimes-0.4.0/tasks/rspec.rake +0 -31
- data/vendor/hitimes-0.4.0/tasks/rubyforge.rake +0 -52
- data/vendor/hitimes-0.4.0/tasks/utils.rb +0 -80
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
h1. Drydock - Easy Command line apps
|
|
2
|
+
|
|
3
|
+
Inspired by "github-gem":http://github.com/defunkt/github-gem
|
|
4
|
+
|
|
5
|
+
Inspired by "bmizerany-frylock":http://github.com/bmizerany/frylock/tree
|
|
6
|
+
|
|
7
|
+
h3. Overview
|
|
8
|
+
|
|
9
|
+
Drydock is a DSL for command line apps.
|
|
10
|
+
|
|
11
|
+
h3. Install
|
|
12
|
+
|
|
13
|
+
git clone git://github.com/delano/drydock.git
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
h3. Examples
|
|
17
|
+
|
|
18
|
+
See bin/example for more.
|
|
19
|
+
|
|
20
|
+
<pre><code>
|
|
21
|
+
require 'rubygems'
|
|
22
|
+
require 'drydock'
|
|
23
|
+
|
|
24
|
+
default :welcome
|
|
25
|
+
|
|
26
|
+
before do
|
|
27
|
+
# You can execute a block before the requests command is executed. Instance
|
|
28
|
+
# variables defined here will be available to all commands.
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
command :welcome do
|
|
32
|
+
# Example: ruby bin/example
|
|
33
|
+
|
|
34
|
+
puts "Meatwad: Science is a mystery to man, isn't it Frylock?"
|
|
35
|
+
print "Frylock: At least we have some commands: "
|
|
36
|
+
|
|
37
|
+
# The commands method returns a hash of Frylock::Command objects
|
|
38
|
+
puts commands.keys.inject([]) { |list, command| list << command.to_s }.sort.join(', ')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
option :f, :found, "A boolean value. Did you find the car?"
|
|
42
|
+
command :findcar do |options|
|
|
43
|
+
# +options+ is a hash containing the options defined above
|
|
44
|
+
# Example: ruby bin/example -f findcar
|
|
45
|
+
|
|
46
|
+
puts "Frylock: So, did they ever find your car?"
|
|
47
|
+
|
|
48
|
+
# The keys to the hash are the long string from the option definition.
|
|
49
|
+
# If only the short string is provided, those will be used instead (i.e. :f).
|
|
50
|
+
puts (!options[:found]) ? "Carl: No" :
|
|
51
|
+
"Carl: Oh, they found part of it, hangin' from a trestle near the turnpike."
|
|
52
|
+
end
|
|
53
|
+
</code></pre>
|
|
54
|
+
|
|
55
|
+
h3. License
|
|
56
|
+
|
|
57
|
+
See LICENSE.txt
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
$: << File.join(
|
|
3
|
+
DRYDOCK_HOME = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
4
|
+
$: << File.join(DRYDOCK_HOME, 'lib')
|
|
5
5
|
|
|
6
6
|
require 'rubygems'
|
|
7
|
-
require '
|
|
7
|
+
require 'drydock'
|
|
8
8
|
|
|
9
|
-
default :
|
|
9
|
+
default :welcome
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
before do
|
|
13
|
-
# You can execute a block before the requests command is executed.
|
|
14
|
-
#
|
|
13
|
+
# You can execute a block before the requests command is executed. Instance
|
|
14
|
+
# variables defined here will be available to all commands.
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
command :
|
|
19
|
-
# Example: ruby bin/example
|
|
18
|
+
command :welcome do
|
|
19
|
+
# Example: ruby bin/example
|
|
20
20
|
|
|
21
21
|
puts "Meatwad: Science is a mystery to man, isn't it Frylock?"
|
|
22
22
|
print "Frylock: At least we have some commands: "
|
|
23
23
|
|
|
24
|
-
# The commands method returns a hash of
|
|
24
|
+
# The commands method returns a hash of Drydock::Command objects
|
|
25
25
|
puts commands.keys.inject([]) { |list, command| list << command.to_s }.sort.join(', ')
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -143,21 +143,21 @@ end
|
|
|
143
143
|
at_exit do
|
|
144
144
|
# This is an example of how to call Frylock in your script.
|
|
145
145
|
begin
|
|
146
|
-
|
|
146
|
+
Drydock.run!(ARGV, STDIN)
|
|
147
147
|
|
|
148
|
-
rescue
|
|
148
|
+
rescue Drydock::UnknownCommand => ex
|
|
149
149
|
STDERR.puts "Frylock: I don't know what the #{ex.name} command is. #{$/}"
|
|
150
150
|
STDERR.puts "Master Shake: I'll tell you what it is, friends... it's shut up and let me eat it."
|
|
151
151
|
|
|
152
|
-
rescue
|
|
152
|
+
rescue Drydock::NoCommandsDefined => ex
|
|
153
153
|
STDERR.puts "Frylock: Carl, I don't want it. And I'd appreciate it if you'd define at least one command. #{$/}"
|
|
154
154
|
STDERR.puts "Carl: Fryman, don't be that way! This sorta thing happens every day! People just don't... you know, talk about it this loud."
|
|
155
155
|
|
|
156
|
-
rescue
|
|
156
|
+
rescue Drydock::InvalidArgument => ex
|
|
157
157
|
STDERR.puts "Frylock: Shake, how many arguments have you not provided a value for this year? #{$/}"
|
|
158
158
|
STDERR.puts "Master Shake: A *lot* more than *you* have! (#{@args.join(', ')})"
|
|
159
159
|
|
|
160
|
-
rescue
|
|
160
|
+
rescue Drydock::MissingArgument => ex
|
|
161
161
|
STDERR.puts "Frylock: I don't know what #{ex.args.join(', ')} is. #{$/}"
|
|
162
162
|
STDERR.puts "Master Shake: I'll tell you what it is, friends... it's shut up and let me eat it."
|
|
163
163
|
|
|
@@ -2,9 +2,9 @@ require 'optparse'
|
|
|
2
2
|
require 'ostruct'
|
|
3
3
|
require 'pp'
|
|
4
4
|
|
|
5
|
-
require '
|
|
5
|
+
require 'drydock/exceptions'
|
|
6
6
|
|
|
7
|
-
module
|
|
7
|
+
module Drydock
|
|
8
8
|
class Command
|
|
9
9
|
attr_reader :cmd, :index
|
|
10
10
|
def initialize(cmd, index, &b)
|
|
@@ -23,7 +23,7 @@ module Frylock
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
module
|
|
26
|
+
module Drydock
|
|
27
27
|
extend self
|
|
28
28
|
|
|
29
29
|
FORWARDED_METHODS = %w(command before alias_command global_option global_usage usage option stdin default commands).freeze
|
|
@@ -179,9 +179,9 @@ module Frylock
|
|
|
179
179
|
|
|
180
180
|
|
|
181
181
|
rescue OptionParser::InvalidOption => ex
|
|
182
|
-
raise
|
|
182
|
+
raise Drydock::InvalidArgument.new(ex.args)
|
|
183
183
|
rescue OptionParser::MissingArgument => ex
|
|
184
|
-
raise
|
|
184
|
+
raise Drydock::MissingArgument.new(ex.args)
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
|
|
@@ -219,10 +219,10 @@ module Frylock
|
|
|
219
219
|
|
|
220
220
|
end
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
eval(<<-end_eval, binding, "(
|
|
222
|
+
Drydock::FORWARDED_METHODS.each do |m|
|
|
223
|
+
eval(<<-end_eval, binding, "(Drydock)", __LINE__)
|
|
224
224
|
def #{m}(*args, &b)
|
|
225
|
-
|
|
225
|
+
Drydock.#{m}(*args, &b)
|
|
226
226
|
end
|
|
227
227
|
end_eval
|
|
228
228
|
end
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stella
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Delano Mandelbaum
|
|
@@ -9,9 +9,19 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-01-
|
|
12
|
+
date: 2009-01-14 00:00:00 -05:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: mongrel
|
|
17
|
+
type: :runtime
|
|
18
|
+
version_requirement:
|
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: "0"
|
|
24
|
+
version:
|
|
15
25
|
- !ruby/object:Gem::Dependency
|
|
16
26
|
name: rspec
|
|
17
27
|
type: :runtime
|
|
@@ -45,6 +55,7 @@ files:
|
|
|
45
55
|
- Rakefile
|
|
46
56
|
- bin/stella
|
|
47
57
|
- bin/stella.bat
|
|
58
|
+
- lib/daemonize.rb
|
|
48
59
|
- lib/pcaplet.rb
|
|
49
60
|
- lib/stella
|
|
50
61
|
- lib/stella/adapter
|
|
@@ -74,11 +85,10 @@ files:
|
|
|
74
85
|
- lib/stella/support.rb
|
|
75
86
|
- lib/stella/sysinfo.rb
|
|
76
87
|
- lib/stella/test
|
|
77
|
-
- lib/stella/test/base.rb
|
|
78
88
|
- lib/stella/test/definition.rb
|
|
79
89
|
- lib/stella/test/run
|
|
80
90
|
- lib/stella/test/run/summary.rb
|
|
81
|
-
- lib/stella/test/
|
|
91
|
+
- lib/stella/test/stats.rb
|
|
82
92
|
- lib/stella/text
|
|
83
93
|
- lib/stella/text/resource.rb
|
|
84
94
|
- lib/stella/text.rb
|
|
@@ -90,13 +100,20 @@ files:
|
|
|
90
100
|
- lib/utils/fileutil.rb
|
|
91
101
|
- lib/utils/httputil.rb
|
|
92
102
|
- lib/utils/mathutil.rb
|
|
103
|
+
- lib/utils/stats.rb
|
|
93
104
|
- lib/utils/textgraph.rb
|
|
94
105
|
- lib/utils/timerutil.rb
|
|
95
106
|
- lib/win32
|
|
96
107
|
- lib/win32/Console
|
|
97
108
|
- lib/win32/Console/ANSI.rb
|
|
98
109
|
- lib/win32/Console.rb
|
|
99
|
-
-
|
|
110
|
+
- tests/01-util_test.rb
|
|
111
|
+
- tests/02-stella-util_test.rb
|
|
112
|
+
- tests/10-stella_test.rb
|
|
113
|
+
- tests/11-stella-storable_test.rb
|
|
114
|
+
- tests/60-stella-command_test.rb
|
|
115
|
+
- tests/80-stella-cli_test.rb
|
|
116
|
+
- tests/spec-helper.rb
|
|
100
117
|
- support/kvm.h
|
|
101
118
|
- support/ruby-pcap-takuma-notes.txt
|
|
102
119
|
- support/ruby-pcap-takuma-patch.txt
|
|
@@ -104,63 +121,19 @@ files:
|
|
|
104
121
|
- support/text/en.yaml
|
|
105
122
|
- support/text/nl.yaml
|
|
106
123
|
- support/useragents.txt
|
|
124
|
+
- vendor/drydock
|
|
125
|
+
- vendor/drydock/bin
|
|
126
|
+
- vendor/drydock/bin/example
|
|
127
|
+
- vendor/drydock/drydock.gemspec
|
|
128
|
+
- vendor/drydock/lib
|
|
129
|
+
- vendor/drydock/lib/drydock
|
|
130
|
+
- vendor/drydock/lib/drydock/exceptions.rb
|
|
131
|
+
- vendor/drydock/lib/drydock.rb
|
|
132
|
+
- vendor/drydock/LICENSE.txt
|
|
133
|
+
- vendor/drydock/README.textile
|
|
134
|
+
- vendor/drydock/test
|
|
135
|
+
- vendor/drydock/test/command_test.rb
|
|
107
136
|
- vendor/frylock
|
|
108
|
-
- vendor/frylock/bin
|
|
109
|
-
- vendor/frylock/bin/example
|
|
110
|
-
- vendor/frylock/frylock.gemspec
|
|
111
|
-
- vendor/frylock/lib
|
|
112
|
-
- vendor/frylock/lib/frylock
|
|
113
|
-
- vendor/frylock/lib/frylock/exceptions.rb
|
|
114
|
-
- vendor/frylock/lib/frylock.rb
|
|
115
|
-
- vendor/frylock/README.textile
|
|
116
|
-
- vendor/frylock/test
|
|
117
|
-
- vendor/frylock/test/command_test.rb
|
|
118
|
-
- vendor/hitimes-0.4.0
|
|
119
|
-
- vendor/hitimes-0.4.0/examples
|
|
120
|
-
- vendor/hitimes-0.4.0/examples/benchmarks.rb
|
|
121
|
-
- vendor/hitimes-0.4.0/examples/stats.rb
|
|
122
|
-
- vendor/hitimes-0.4.0/ext
|
|
123
|
-
- vendor/hitimes-0.4.0/ext/extconf.rb
|
|
124
|
-
- vendor/hitimes-0.4.0/ext/hitimes_ext.c
|
|
125
|
-
- vendor/hitimes-0.4.0/ext/hitimes_instant_clock_gettime.c
|
|
126
|
-
- vendor/hitimes-0.4.0/ext/hitimes_instant_osx.c
|
|
127
|
-
- vendor/hitimes-0.4.0/ext/hitimes_instant_windows.c
|
|
128
|
-
- vendor/hitimes-0.4.0/ext/hitimes_interval.c
|
|
129
|
-
- vendor/hitimes-0.4.0/ext/hitimes_interval.h
|
|
130
|
-
- vendor/hitimes-0.4.0/ext/hitimes_stats.c
|
|
131
|
-
- vendor/hitimes-0.4.0/ext/hitimes_stats.h
|
|
132
|
-
- vendor/hitimes-0.4.0/ext/rbconfig-mingw.rb
|
|
133
|
-
- vendor/hitimes-0.4.0/ext/rbconfig.rb
|
|
134
|
-
- vendor/hitimes-0.4.0/gemspec.rb
|
|
135
|
-
- vendor/hitimes-0.4.0/HISTORY
|
|
136
|
-
- vendor/hitimes-0.4.0/lib
|
|
137
|
-
- vendor/hitimes-0.4.0/lib/hitimes
|
|
138
|
-
- vendor/hitimes-0.4.0/lib/hitimes/mutexed_stats.rb
|
|
139
|
-
- vendor/hitimes-0.4.0/lib/hitimes/paths.rb
|
|
140
|
-
- vendor/hitimes-0.4.0/lib/hitimes/stats.rb
|
|
141
|
-
- vendor/hitimes-0.4.0/lib/hitimes/timer.rb
|
|
142
|
-
- vendor/hitimes-0.4.0/lib/hitimes/version.rb
|
|
143
|
-
- vendor/hitimes-0.4.0/lib/hitimes.rb
|
|
144
|
-
- vendor/hitimes-0.4.0/LICENSE.txt
|
|
145
|
-
- vendor/hitimes-0.4.0/Rakefile
|
|
146
|
-
- vendor/hitimes-0.4.0/README
|
|
147
|
-
- vendor/hitimes-0.4.0/spec
|
|
148
|
-
- vendor/hitimes-0.4.0/spec/interval_spec.rb
|
|
149
|
-
- vendor/hitimes-0.4.0/spec/mutex_stats_spec.rb
|
|
150
|
-
- vendor/hitimes-0.4.0/spec/paths_spec.rb
|
|
151
|
-
- vendor/hitimes-0.4.0/spec/spec_helper.rb
|
|
152
|
-
- vendor/hitimes-0.4.0/spec/stats_spec.rb
|
|
153
|
-
- vendor/hitimes-0.4.0/spec/timer_spec.rb
|
|
154
|
-
- vendor/hitimes-0.4.0/spec/version_spec.rb
|
|
155
|
-
- vendor/hitimes-0.4.0/tasks
|
|
156
|
-
- vendor/hitimes-0.4.0/tasks/announce.rake
|
|
157
|
-
- vendor/hitimes-0.4.0/tasks/config.rb
|
|
158
|
-
- vendor/hitimes-0.4.0/tasks/distribution.rake
|
|
159
|
-
- vendor/hitimes-0.4.0/tasks/documentation.rake
|
|
160
|
-
- vendor/hitimes-0.4.0/tasks/extension.rake
|
|
161
|
-
- vendor/hitimes-0.4.0/tasks/rspec.rake
|
|
162
|
-
- vendor/hitimes-0.4.0/tasks/rubyforge.rake
|
|
163
|
-
- vendor/hitimes-0.4.0/tasks/utils.rb
|
|
164
137
|
- vendor/useragent
|
|
165
138
|
- vendor/useragent/init.rb
|
|
166
139
|
- vendor/useragent/lib
|
data/lib/stella/test/base.rb
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
module Stella::Test
|
|
3
|
-
|
|
4
|
-
module Base
|
|
5
|
-
|
|
6
|
-
attr_reader :message
|
|
7
|
-
attr_reader :elapsed_time_avg, :transaction_rate_avg, :vusers_avg, :response_time_avg
|
|
8
|
-
attr_reader :elapsed_time_sdev, :transaction_rate_sdev, :vusers_sdev, :response_time_sdev
|
|
9
|
-
attr_accessor :transactions_total, :headers_transferred_total, :data_transferred_total
|
|
10
|
-
attr_accessor :successful_total, :failed_total, :elapsed_time_total, :throughput_avg, :throughput_sdev
|
|
11
|
-
|
|
12
|
-
def availability
|
|
13
|
-
return 0 if @successful_total == 0
|
|
14
|
-
begin
|
|
15
|
-
(@transactions_total / @successful_total).to_f * 100
|
|
16
|
-
rescue => ex
|
|
17
|
-
0.0
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# Defines the fields the are output by to_hash and to_csv.
|
|
23
|
-
# For to_csv, this also determines the field order
|
|
24
|
-
def field_names
|
|
25
|
-
[
|
|
26
|
-
:message,
|
|
27
|
-
:elapsed_time_avg, :transaction_rate_avg, :vusers_avg, :response_time_avg,
|
|
28
|
-
:elapsed_time_sdev, :transaction_rate_sdev, :vusers_sdev, :response_time_sdev,
|
|
29
|
-
|
|
30
|
-
:transactions_total, :successful_total, :failed_total,
|
|
31
|
-
:data_transferred_total, :headers_transferred_total,
|
|
32
|
-
|
|
33
|
-
:elapsed_time_total, :availability, :throughput_avg, :throughput_sdev
|
|
34
|
-
]
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
end
|
data/lib/stella/test/summary.rb
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
require 'stella/test/base'
|
|
3
|
-
|
|
4
|
-
module Stella::Test
|
|
5
|
-
|
|
6
|
-
# Stella::Test::Summary
|
|
7
|
-
class Summary < Stella::Storable
|
|
8
|
-
include Base
|
|
9
|
-
|
|
10
|
-
attr_reader :runs
|
|
11
|
-
|
|
12
|
-
def initialize(msg="")
|
|
13
|
-
@message = msg
|
|
14
|
-
@runs = []
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# Add a TestRun object to the list
|
|
18
|
-
def add_run(run)
|
|
19
|
-
raise "I got a #{run.class} but I wanted a Run::Summary" unless run.is_a?(Run::Summary)
|
|
20
|
-
@runs << run
|
|
21
|
-
calculate
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
def calculate
|
|
26
|
-
# We simply keep a running tally of these
|
|
27
|
-
@transactions_total = 0
|
|
28
|
-
@headers_transferred_total = 0
|
|
29
|
-
@data_transferred_total = 0
|
|
30
|
-
@elapsed_time_total = 0
|
|
31
|
-
@successful_total = 0
|
|
32
|
-
@failed_total = 0
|
|
33
|
-
|
|
34
|
-
# We keep a list of the values for averaging and std dev
|
|
35
|
-
elapsed_times = []
|
|
36
|
-
transaction_rates = []
|
|
37
|
-
vusers_list = []
|
|
38
|
-
response_times = []
|
|
39
|
-
response_time = []
|
|
40
|
-
transaction_rate = []
|
|
41
|
-
throughput = []
|
|
42
|
-
vusers = []
|
|
43
|
-
|
|
44
|
-
# Each run is the summary of a single run (i.e. run01/SUMMARY.csv)
|
|
45
|
-
runs.each do |run|
|
|
46
|
-
# These are totaled
|
|
47
|
-
@transactions_total += run.transactions
|
|
48
|
-
@headers_transferred_total += run.headers_transferred
|
|
49
|
-
@data_transferred_total += run.data_transferred
|
|
50
|
-
@successful_total += run.successful
|
|
51
|
-
@failed_total += run.failed
|
|
52
|
-
@elapsed_time_total += run.elapsed_time
|
|
53
|
-
|
|
54
|
-
# These are used for standard deviation
|
|
55
|
-
elapsed_times << run.elapsed_time
|
|
56
|
-
transaction_rates << run.transaction_rate
|
|
57
|
-
vusers_list << run.vusers
|
|
58
|
-
response_times << run.response_time
|
|
59
|
-
throughput << run.throughput
|
|
60
|
-
response_time << run.response_time
|
|
61
|
-
transaction_rate << run.transaction_rate
|
|
62
|
-
vusers << run.vusers
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
# Calculate Averages
|
|
66
|
-
@elapsed_time_avg = elapsed_times.average
|
|
67
|
-
@throughput_avg = throughput.average
|
|
68
|
-
@response_time_avg = response_time.average
|
|
69
|
-
@transaction_rate_avg = transaction_rate.average
|
|
70
|
-
@vusers_avg = vusers.average
|
|
71
|
-
|
|
72
|
-
# Calculate Standard Deviations
|
|
73
|
-
@elapsed_time_sdev = elapsed_times.standard_deviation
|
|
74
|
-
@throughput_sdev= throughput.standard_deviation
|
|
75
|
-
@transaction_rate_sdev = transaction_rates.standard_deviation
|
|
76
|
-
@vusers_sdev = vusers_list.standard_deviation
|
|
77
|
-
@response_time_sdev = response_times.standard_deviation
|
|
78
|
-
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
= Changelog
|
|
2
|
-
== Version 0.4.0 2008-12-20
|
|
3
|
-
|
|
4
|
-
* Added new stat 'rate'
|
|
5
|
-
* Added new stat method to_hash
|
|
6
|
-
* Added MutexedStats class for threadsafe stats collection
|
|
7
|
-
- not needed when used in MRI 1.8.x
|
|
8
|
-
* remove stale dependency on mkrf
|
|
9
|
-
|
|
10
|
-
== Version 0.3.0
|
|
11
|
-
|
|
12
|
-
* switched to extconf for building extensions
|
|
13
|
-
* first release of windows binary gem
|
|
14
|
-
* reverted back to normal rdoc
|
|
15
|
-
|
|
16
|
-
== Version 0.2.1
|
|
17
|
-
|
|
18
|
-
* added Timer#rate method
|
|
19
|
-
* switched to darkfish rdoc
|
|
20
|
-
|
|
21
|
-
== Version 0.2.0
|
|
22
|
-
|
|
23
|
-
* Performance improvements
|
|
24
|
-
* Added Stats class
|
|
25
|
-
|
|
26
|
-
== Version 0.1.0
|
|
27
|
-
|
|
28
|
-
* Initial completion
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2008 Jeremy Hinegardner
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
-
the Software without restriction, including without limitation the rights to
|
|
6
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
-
so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
|
11
|
-
copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
-
SOFTWARE.
|
data/vendor/hitimes-0.4.0/README
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
== hitimes
|
|
2
|
-
|
|
3
|
-
* Homepage[http://copiousfreetime.rubyforge.org/hitimes]
|
|
4
|
-
* {Rubyforge project}[http://rubyforge.org/projects/copiousfreetime/]
|
|
5
|
-
* email jeremy at copiousfreetime dot org
|
|
6
|
-
* git clone url git://github.com/copiousfreetime/hitimes.git
|
|
7
|
-
|
|
8
|
-
== INSTALL
|
|
9
|
-
|
|
10
|
-
* gem install hitimes
|
|
11
|
-
|
|
12
|
-
== DESCRIPTION
|
|
13
|
-
|
|
14
|
-
Hitimes is a fast, high resolution timer library for recording
|
|
15
|
-
performance metrics. It uses the appropriate C method calls for each
|
|
16
|
-
system to get the highest granularity time increments possible.
|
|
17
|
-
|
|
18
|
-
It currently supports any system with the POSIX call clock_gettime(),
|
|
19
|
-
Mac OS X and Windows.
|
|
20
|
-
|
|
21
|
-
Using Hitimes can be faster than using a series of Time.new calls, and
|
|
22
|
-
it will have a much higher granularity. It is definitely faster than
|
|
23
|
-
using Process.times.
|
|
24
|
-
|
|
25
|
-
== SYNOPSIS
|
|
26
|
-
|
|
27
|
-
Use Hitimes::Interval to calculate only the duration of a block of code
|
|
28
|
-
|
|
29
|
-
duration = Hitimes::Interval.measure do
|
|
30
|
-
# some operation ...
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
puts duration
|
|
34
|
-
|
|
35
|
-
Use a Hitimes::Timer to calculate statistics about an iterative operation
|
|
36
|
-
|
|
37
|
-
timer = Hitimes::Timer.new
|
|
38
|
-
collection.each do |item|
|
|
39
|
-
timer.start
|
|
40
|
-
# .. do something with item
|
|
41
|
-
timer.stop
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
puts timer.mean
|
|
45
|
-
puts timer.median
|
|
46
|
-
puts timer.max
|
|
47
|
-
puts timer.min
|
|
48
|
-
puts timer.stddev
|
|
49
|
-
puts timer.rate
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
== CHANGES
|
|
53
|
-
|
|
54
|
-
Read the HISTORY file.
|
|
55
|
-
|
|
56
|
-
== CREDITS
|
|
57
|
-
|
|
58
|
-
* Bruce Williams for suggesting the idea
|
|
59
|
-
|
|
60
|
-
== MIT LICENSE
|
|
61
|
-
|
|
62
|
-
Copyright (c) 2008 Jeremy Hinegardner
|
|
63
|
-
|
|
64
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
65
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
66
|
-
the Software without restriction, including without limitation the rights to
|
|
67
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
68
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
|
69
|
-
so, subject to the following conditions:
|
|
70
|
-
|
|
71
|
-
The above copyright notice and this permission notice shall be included in all
|
|
72
|
-
copies or substantial portions of the Software.
|
|
73
|
-
|
|
74
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
75
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
76
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
77
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
78
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
79
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
80
|
-
SOFTWARE.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#--
|
|
2
|
-
# Copyright (c) 2008 Jeremy Hinegardner
|
|
3
|
-
# All rights reserved. See LICENSE and/or COPYING for details.
|
|
4
|
-
#++
|
|
5
|
-
|
|
6
|
-
#-------------------------------------------------------------------------------
|
|
7
|
-
# make sure our project's top level directory and the lib directory are added to
|
|
8
|
-
# the ruby search path.
|
|
9
|
-
#-------------------------------------------------------------------------------
|
|
10
|
-
$: << File.expand_path(File.join(File.dirname(__FILE__),"ext"))
|
|
11
|
-
$: << File.expand_path(File.join(File.dirname(__FILE__),"lib"))
|
|
12
|
-
$: << File.expand_path(File.dirname(__FILE__))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
#-------------------------------------------------------------------------------
|
|
16
|
-
# load the global project configuration and add in the top level clean and
|
|
17
|
-
# clobber tasks so that other tasks can utilize those constants if necessary
|
|
18
|
-
# This loads up the defaults for the whole project configuration
|
|
19
|
-
#-------------------------------------------------------------------------------
|
|
20
|
-
require 'rubygems'
|
|
21
|
-
require 'tasks/config.rb'
|
|
22
|
-
require 'rake/clean'
|
|
23
|
-
|
|
24
|
-
#-------------------------------------------------------------------------------
|
|
25
|
-
# Main configuration for the project, these overwrite the items that are in
|
|
26
|
-
# tasks/config.rb
|
|
27
|
-
#-------------------------------------------------------------------------------
|
|
28
|
-
require 'hitimes/version'
|
|
29
|
-
require 'hitimes/paths'
|
|
30
|
-
|
|
31
|
-
Configuration.for("project") {
|
|
32
|
-
name "hitimes"
|
|
33
|
-
version Hitimes::VERSION
|
|
34
|
-
author "Jeremy Hinegardner"
|
|
35
|
-
email "jeremy@copiousfreetime.org"
|
|
36
|
-
homepage "http://copiousfreetime.rubyforge.org/hitimes/"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#-------------------------------------------------------------------------------
|
|
40
|
-
# load up all the project tasks and setup the default task to be the
|
|
41
|
-
# test:default task.
|
|
42
|
-
#-------------------------------------------------------------------------------
|
|
43
|
-
Configuration.for("packaging").files.tasks.each do |tasklib|
|
|
44
|
-
import tasklib
|
|
45
|
-
end
|
|
46
|
-
task :default => 'test:default'
|
|
47
|
-
|
|
48
|
-
#-------------------------------------------------------------------------------
|
|
49
|
-
# Finalize the loading of all pending imports and update the top level clobber
|
|
50
|
-
# task to depend on all possible sub-level tasks that have a name like
|
|
51
|
-
# ':clobber' in other namespaces. This allows us to say:
|
|
52
|
-
#
|
|
53
|
-
# rake clobber
|
|
54
|
-
#
|
|
55
|
-
# and it will get everything.
|
|
56
|
-
#-------------------------------------------------------------------------------
|
|
57
|
-
Rake.application.load_imports
|
|
58
|
-
Rake.application.tasks.each do |t|
|
|
59
|
-
if t.name =~ /:clobber/ then
|
|
60
|
-
task :clobber => [t.name]
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|