celluloid-benchmark 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87902d700dba56fd25b4d8a800780d3ad537632d
4
- data.tar.gz: f15b09d76bd846a93921e349860557730284391f
3
+ metadata.gz: b2c83cab39ebec2496d3846d841067dc31cbb56c
4
+ data.tar.gz: 9335f6e4170dc05f33c9fd7003e50d0296e0f16b
5
5
  SHA512:
6
- metadata.gz: 4f3dde3a1daeb364b7c4c9e648087ef65c7a2684aa3befdbf09027abfed02d927a33f811ac7e3d8faa97de8e32f5da8cebe2459536024478895b034e6e3b2867
7
- data.tar.gz: 5bbe5bb2e854a9acc7459ea6bfcfba0f35c832ffbb9c43ead4433fb27a77f93543e935000dcdf4e1e838b86c68852ab77a98713baeb5f184a67b93d9c5da57a4
6
+ metadata.gz: 5fbb3671302dff9d84c3b6d66c2d2c5d4e6456e4e829681f701715f1d09294007aab836d8a487c5c6874ed2e4da930590d30765a3c36866e0a4c1f4d8eaece4d
7
+ data.tar.gz: 172c2df471c5c81ab179b532c3e35cdf4d9e044b906f14ec85cb0f21e7f554811377d8b2fb9445bccecf728adc26c9f1cd921d58600de2daf886e22b2069463d
@@ -12,12 +12,13 @@ opts = Slop.parse(help: true) do
12
12
  end
13
13
 
14
14
  require_relative "../lib/celluloid_benchmark"
15
+ require_relative "../lib/celluloid_benchmark/text_formatter"
15
16
  require_relative "../lib/celluloid_benchmark/visitor"
16
17
 
17
18
  benchmark_run = CelluloidBenchmark::Runner.run opts.to_hash
18
19
 
19
20
  puts
20
- benchmark_run.benchmarks.each do |trans|
21
+ benchmark_run.benchmarks.sort_by(&:label).each do |trans|
21
22
  puts "#{trans.ok? ? '[ OK ]' : '[FAIL]'} #{trans.label}"
22
23
  end
23
24
 
@@ -25,6 +26,6 @@ puts
25
26
  p "#{benchmark_run.requests / benchmark_run.elapsed_time} requests per second. #{benchmark_run.requests} requests in #{benchmark_run.elapsed_time} seconds by #{benchmark_run.visitors} visitors. Network time: #{benchmark_run.network_time}"
26
27
 
27
28
  puts
28
- p benchmark_run
29
+ CelluloidBenchmark::TextFormatter.to_s(benchmark_run)
29
30
 
30
31
  exit benchmark_run.ok?
@@ -41,7 +41,19 @@ module CelluloidBenchmark
41
41
  end
42
42
 
43
43
  def average_response_time
44
- response_times.reduce(:+) / response_times.size
44
+ response_times.reduce(:+) / responses
45
+ end
46
+
47
+ def min_response_time
48
+ response_times.min
49
+ end
50
+
51
+ def max_response_time
52
+ response_times.max
53
+ end
54
+
55
+ def responses
56
+ response_times.size
45
57
  end
46
58
  end
47
59
  end
@@ -0,0 +1,9 @@
1
+ require "table_print"
2
+
3
+ module CelluloidBenchmark
4
+ class TextFormatter
5
+ def self.to_s(benchmark_run)
6
+ tp benchmark_run.benchmarks, :label, :threshold, :average_response_time, :min_response_time, :max_response_time, :responses
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module CelluloidBenchmark
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Willson
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: table_print
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: |-
98
112
  Celluloid Benchmark realistically load tests websites. Write expressive, concise load tests in Ruby. Use Rubinius and Celluloid
99
113
  forpec high concurrency. Use Mechanize for a realistic (albeit non-JavaScript) browser client.
@@ -113,6 +127,7 @@ files:
113
127
  - lib/celluloid_benchmark/runner.rb
114
128
  - lib/celluloid_benchmark/session.rb
115
129
  - lib/celluloid_benchmark/target.rb
130
+ - lib/celluloid_benchmark/text_formatter.rb
116
131
  - lib/celluloid_benchmark/version.rb
117
132
  - lib/celluloid_benchmark/visitor.rb
118
133
  - lib/celluloid_benchmark/visitor_group.rb