benchmark_harness 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/benchmark_harness.gemspec +1 -1
- data/lib/benchmark_harness/collection.rb +2 -2
- data/spec/benchmark_harness_spec.rb +10 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/benchmark_harness.gemspec
CHANGED
@@ -3,7 +3,7 @@ class BenchmarkHarness
|
|
3
3
|
|
4
4
|
# order corresponds to values in each sample
|
5
5
|
KEYS = [:user, :system, :children_user, :children_system, :real]
|
6
|
-
STATS = [:mean, :median, :mode, :range, :standard_deviation, :variance]
|
6
|
+
STATS = [:mean, :median, :mode, :range, :min, :max, :standard_deviation, :variance]
|
7
7
|
STATS_HUMAN = STATS.collect{|s| s.to_s.sub(/_/, " ").capitalize}
|
8
8
|
|
9
9
|
# Sorts values into named vectors:
|
@@ -24,7 +24,7 @@ class BenchmarkHarness
|
|
24
24
|
# also defines the method so that it can optionally take a key.
|
25
25
|
# If they key is present, return result for just that vector;
|
26
26
|
# otherwise return hash of results for all keys/vectors
|
27
|
-
|
27
|
+
STATS.each do |method_name|
|
28
28
|
class_eval <<-END
|
29
29
|
def #{method_name}(key = nil)
|
30
30
|
if key
|
@@ -113,4 +113,14 @@ describe "BenchmarkHarness" do
|
|
113
113
|
BenchmarkHarness.collections.should be_empty
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
describe "#print" do
|
118
|
+
it "should print without throwing an error" do
|
119
|
+
2.times{
|
120
|
+
StringExample.concatenate_with_plus("Hello ", "Dave")
|
121
|
+
}
|
122
|
+
lambda{BenchmarkHarness.collections[:plus].print}.should_not raise_error
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
116
126
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark_harness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Higginbotham
|