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 +4 -4
- data/lib/benchmark/http/command/concurrency.rb +3 -1
- data/lib/benchmark/http/statistics.rb +2 -13
- data/lib/benchmark/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1051b210823295993962642c3332aed8d67e8160046ed22bb40f0848eb8ab5e8
|
4
|
+
data.tar.gz: 7da401da4d648dac3ec2f7ef8d378f6e0a09f44f14ee1a6d482d09f5dc64b12f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 /
|
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
|
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.
|
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-
|
11
|
+
date: 2019-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|