benchmark-http 0.8.1 → 0.8.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a12b67daeeadc34944c967a8f441da017cb3a31f3bb778893b344b3b24115d1
|
4
|
+
data.tar.gz: efff4138d8be9145ab9df016162bce6bbf2da9e4fcfd36cebda36acc9601a773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd41f22b3e11709045bb9e63ab41a9069f9548c243ef1ab365e045eaf7f548ff0b88d03060404404e68c2484cfbc0dbfa4b2101f11764c5f70f0ad9a5197e110
|
7
|
+
data.tar.gz: 59cce9e283b1ed06e49d34c7159ff2b883455b474b057c9b1c932427bb31e9b8421224288b1c9d5269da4da10271d922697a645c8df319393fa61c2204ba1bc3
|
@@ -64,7 +64,7 @@ module Benchmark
|
|
64
64
|
end
|
65
65
|
end.each(&:wait)
|
66
66
|
|
67
|
-
puts "I made #{statistics.
|
67
|
+
puts "I made #{statistics.size} requests in #{Seconds[statistics.sequential_duration]}. The per-request latency was #{Seconds[statistics.latency]}. That's #{statistics.per_second.round(2)} asynchronous requests/second."
|
68
68
|
|
69
69
|
puts "\t Variance: #{Seconds[statistics.variance]}"
|
70
70
|
puts "\tStandard Deviation: #{Seconds[statistics.standard_deviation]}"
|
@@ -48,11 +48,11 @@ module Benchmark
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def count
|
51
|
-
@samples.
|
51
|
+
@samples.size
|
52
52
|
end
|
53
53
|
|
54
54
|
def per_second(duration = self.sequential_duration)
|
55
|
-
@samples.
|
55
|
+
@samples.size.to_f / duration.to_f
|
56
56
|
end
|
57
57
|
|
58
58
|
def latency
|
@@ -67,12 +67,12 @@ module Benchmark
|
|
67
67
|
|
68
68
|
def average
|
69
69
|
if @samples.any?
|
70
|
-
@samples.sum / @samples.
|
70
|
+
@samples.sum / @samples.size
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
74
|
def valid?
|
75
|
-
@samples.
|
75
|
+
@samples.size > 1
|
76
76
|
end
|
77
77
|
|
78
78
|
# Computes Population Variance, σ^2.
|
@@ -80,7 +80,7 @@ module Benchmark
|
|
80
80
|
if valid?
|
81
81
|
average = self.average
|
82
82
|
|
83
|
-
return @samples.map{|n| (n - average)**2}.sum / @samples.
|
83
|
+
return @samples.map{|n| (n - average)**2}.sum / @samples.size
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -93,7 +93,7 @@ module Benchmark
|
|
93
93
|
|
94
94
|
def standard_error
|
95
95
|
if standard_deviation = self.standard_deviation
|
96
|
-
standard_deviation / Math.sqrt(@samples.
|
96
|
+
standard_deviation / Math.sqrt(@samples.size)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -135,7 +135,7 @@ module Benchmark
|
|
135
135
|
|
136
136
|
def print(out = STDOUT)
|
137
137
|
if self.valid?
|
138
|
-
out.puts "#{@samples.
|
138
|
+
out.puts "#{@samples.size} samples. #{per_second} requests per second. S/D: #{Seconds[standard_deviation]}."
|
139
139
|
else
|
140
140
|
out.puts "Not enough samples."
|
141
141
|
end
|
@@ -144,7 +144,7 @@ module Benchmark
|
|
144
144
|
private
|
145
145
|
|
146
146
|
def confident?(factor)
|
147
|
-
if @samples.
|
147
|
+
if @samples.size > @concurrency
|
148
148
|
return self.standard_error < (self.average * factor)
|
149
149
|
end
|
150
150
|
|
@@ -170,7 +170,7 @@ module Benchmark
|
|
170
170
|
if valid?
|
171
171
|
counts = @responses.sort.collect{|status, count| "#{count}x #{status}"}.join("; ")
|
172
172
|
|
173
|
-
out.puts "#{@samples.
|
173
|
+
out.puts "#{@samples.size} samples: #{counts}. #{per_second.round(2)} requests per second. S/D: #{Seconds[standard_deviation]}."
|
174
174
|
else
|
175
175
|
out.puts "Not enough samples."
|
176
176
|
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.8.
|
4
|
+
version: 0.8.2
|
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-
|
11
|
+
date: 2019-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
168
|
+
rubygems_version: 3.0.6
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: An asynchronous benchmark toolbox for modern HTTP servers.
|