benchmark-http 0.6.0 → 0.7.0

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
  SHA256:
3
- metadata.gz: 91583a8d78b4215f77dc12d1475ff8bbcd1665b01069ed909e206167a37a3988
4
- data.tar.gz: 97528282190b4293619e4540bcf8ca32678d4079d649d08cbb1bc3284b80399c
3
+ metadata.gz: 1051b210823295993962642c3332aed8d67e8160046ed22bb40f0848eb8ab5e8
4
+ data.tar.gz: 7da401da4d648dac3ec2f7ef8d378f6e0a09f44f14ee1a6d482d09f5dc64b12f
5
5
  SHA512:
6
- metadata.gz: 695e6179adc424baea5eef56b5692c44fa814d6377626b1cab40e1de643fe0ce359dbc0288c3c797a2d253211bb700107fa57449915e48c38a57812a51fe309c
7
- data.tar.gz: 0b40ecc5fbd9c08ea8b6a8a433527c4c9ae1d245407953949d06d83478092814f55ee3e77df44f10733eac3baf1a6afaaf21c31701d4432ded2b9cad6b8d0b9b
6
+ metadata.gz: 4525e416cc2f823ee39e888bdb66cf37c8fd284fbcf2466252dcdb6c954c86add90cfbd5bdc0a8e14f27df298cb5651335bde1a1169189f974fd1334aa7f774c
7
+ data.tar.gz: cb4a1eef78767368407f9fad3235b4a3446cbe5d327006b019cb78c47ee4bbce24183f7530a047820f0bcddda1b851282a6a30c8ec9142f205b72ffa2bbd8767
@@ -45,6 +45,7 @@ module Benchmark
45
45
  end
46
46
 
47
47
  def measure_performance(concurrency, endpoint, request_path)
48
+ puts
48
49
  puts "I am running #{concurrency} asynchronous tasks that will each make sequential requests..."
49
50
 
50
51
  statistics = Statistics.new(concurrency)
@@ -62,7 +63,8 @@ module Benchmark
62
63
  end
63
64
  end.each(&:wait)
64
65
 
65
- puts "I made #{statistics.count} requests in #{Seconds[statistics.sequential_duration]}. The per-request latency was #{Seconds[statistics.latency]}. That's #{statistics.per_second} asynchronous requests/second."
66
+ puts "I made #{statistics.count} requests in #{Seconds[statistics.sequential_duration]}. The per-request latency was #{Seconds[statistics.latency]}. That's #{statistics.per_second.round(2)} asynchronous requests/second."
67
+
66
68
  puts "\t Variance: #{Seconds[statistics.variance]}"
67
69
  puts "\tStandard Deviation: #{Seconds[statistics.standard_deviation]}"
68
70
  puts "\t Standard Error: #{statistics.standard_error}"
@@ -26,8 +26,6 @@ module Benchmark
26
26
  def initialize(concurrency = 0)
27
27
  @samples = []
28
28
 
29
- @total_time = 0
30
-
31
29
  # The number of currently executing measurements:
32
30
  @count = 0
33
31
 
@@ -38,9 +36,6 @@ module Benchmark
38
36
  # The individual samples' durations.
39
37
  attr :samples
40
38
 
41
- # The sequential time of all samples.
42
- attr :total_time
43
-
44
39
  # The maximum number of executing measurements at any one time.
45
40
  attr :concurrency
46
41
 
@@ -56,8 +51,8 @@ module Benchmark
56
51
  @samples.count
57
52
  end
58
53
 
59
- def per_second
60
- @samples.count.to_f / total_time.to_f
54
+ def per_second(duration = self.sequential_duration)
55
+ @samples.count.to_f / duration.to_f
61
56
  end
62
57
 
63
58
  def latency
@@ -128,15 +123,9 @@ module Benchmark
128
123
  return result
129
124
  ensure
130
125
  @count -= 1
131
-
132
- if @count == 0 and end_time
133
- @total_time += end_time - @start_time
134
- @start_time = nil
135
- end
136
126
  end
137
127
 
138
128
  def sample(confidence_factor, &block)
139
- # warmup
140
129
  yield
141
130
 
142
131
  begin
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Benchmark
22
22
  module HTTP
23
- VERSION = "0.6.0"
23
+ VERSION = "0.7.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-io