wbench 1.1.0 → 1.1.1
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/README.md +2 -2
- data/lib/javascripts/wbench.js +3 -3
- data/lib/wbench/version.rb +1 -1
- data/spec/wbench/stats_spec.rb +18 -6
- data/spec/wbench/timing_hash_spec.rb +5 -5
- data/spec/wbench/titleizer_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e110770c2daff6c5bffdd9d3a652c915ee8df5fe
|
4
|
+
data.tar.gz: df9085f2b6fb369435de6025440b466f06de53df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 108b0526a7abcf96fd30e19b4941c865856c22ca7b95bd6f27db14156b04e571a4ce00738ffcd4fcd46f2ae58a161bcaf7c9cf3de55a3d74d2252996183b62d9
|
7
|
+
data.tar.gz: ffafed441d0baacd1cc637238c92cd1378fde25e889cea83ad7d3dc2cce6ce4671cf00aebbf7e5a62a5950b811a2880abfd2a2877dd61c45869256d1135d6136
|
data/README.md
CHANGED
@@ -165,9 +165,9 @@ skewing your results for the actual page load.
|
|
165
165
|
|
166
166
|
The cookie format is the same used for curl, so an example might be
|
167
167
|
|
168
|
-
```
|
168
|
+
```bash
|
169
169
|
$ wbench -c "session_id=4000; theme=blue" https://www.desktoppr.co/wallpapers
|
170
|
-
|
170
|
+
```
|
171
171
|
|
172
172
|
### Custom event timings
|
173
173
|
|
data/lib/javascripts/wbench.js
CHANGED
@@ -95,15 +95,15 @@ window.WBench = {
|
|
95
95
|
},
|
96
96
|
|
97
97
|
performanceTimings: function() {
|
98
|
-
resultTimings = window.performance.timing;
|
98
|
+
resultTimings = window.performance.timing.toJSON();
|
99
99
|
|
100
100
|
// Use user defined timings that are added via window.performance.mark('event name')
|
101
101
|
if(typeof(window.performance.getEntriesByType) === 'function') {
|
102
102
|
window.performance.getEntriesByType('mark').forEach(function(item) {
|
103
103
|
resultTimings[item.name] = Math.ceil(window.performance.timing.navigationStart + item.startTime);
|
104
104
|
});
|
105
|
-
}
|
105
|
+
}
|
106
106
|
|
107
107
|
return resultTimings;
|
108
108
|
}
|
109
|
-
}
|
109
|
+
};
|
data/lib/wbench/version.rb
CHANGED
data/spec/wbench/stats_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe WBench::Stats do
|
|
4
4
|
subject(:stats) { described_class.new([1,6,2,8,3]) }
|
5
5
|
|
6
6
|
it 'returns the middle result' do
|
7
|
-
stats.median.
|
7
|
+
expect(stats.median).to eq(3)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -12,7 +12,7 @@ describe WBench::Stats do
|
|
12
12
|
subject(:stats) { described_class.new([1,6,2,8,3,9]) }
|
13
13
|
|
14
14
|
it 'returns the higher of the two middle values' do
|
15
|
-
stats.median.
|
15
|
+
expect(stats.median).to eq(6)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -20,24 +20,36 @@ describe WBench::Stats do
|
|
20
20
|
describe '#sum' do
|
21
21
|
subject(:stats) { described_class.new([2,4,4,4,5,5,7,9]) }
|
22
22
|
|
23
|
-
|
23
|
+
describe '#sum' do
|
24
|
+
subject { super().sum }
|
25
|
+
it { is_expected.to eq(40) }
|
26
|
+
end # see: http://en.wikipedia.org/wiki/Standard_deviation
|
24
27
|
end
|
25
28
|
|
26
29
|
describe '#mean' do
|
27
30
|
subject(:stats) { described_class.new([2,4,4,4,5,5,7,9]) }
|
28
31
|
|
29
|
-
|
32
|
+
describe '#mean' do
|
33
|
+
subject { super().mean }
|
34
|
+
it { is_expected.to eq(5) }
|
35
|
+
end # see: http://en.wikipedia.org/wiki/Standard_deviation
|
30
36
|
end
|
31
37
|
|
32
38
|
describe '#sample_variance' do
|
33
39
|
subject(:stats) { described_class.new([2,4,4,4,5,5,7,9]) }
|
34
40
|
|
35
|
-
|
41
|
+
describe '#sample_variance' do
|
42
|
+
subject { super().sample_variance }
|
43
|
+
it { is_expected.to eq(4) }
|
44
|
+
end # see: http://en.wikipedia.org/wiki/Standard_deviation
|
36
45
|
end
|
37
46
|
|
38
47
|
describe '#std_dev' do
|
39
48
|
subject(:stats) { described_class.new([2,4,4,4,5,5,7,9]) }
|
40
49
|
|
41
|
-
|
50
|
+
describe '#std_dev' do
|
51
|
+
subject { super().std_dev }
|
52
|
+
it { is_expected.to eq(2) }
|
53
|
+
end # see: http://en.wikipedia.org/wiki/Standard_deviation
|
42
54
|
end
|
43
55
|
end
|
@@ -4,17 +4,17 @@ describe WBench::TimingHash do
|
|
4
4
|
subject { described_class.new(timings) }
|
5
5
|
|
6
6
|
it 'removes keys with a value of 0' do
|
7
|
-
subject.
|
7
|
+
expect(subject).not_to have_key :nope
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'offsets each value by the starting(lowest) value' do
|
11
|
-
subject[:start].
|
12
|
-
subject[:middle].
|
13
|
-
subject[:end].
|
11
|
+
expect(subject[:start]).to eq(0)
|
12
|
+
expect(subject[:middle]).to eq(5)
|
13
|
+
expect(subject[:end]).to eq(10)
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'orders the hash by value, lowest first' do
|
17
|
-
subject.first.
|
17
|
+
expect(subject.first).to eq([:start, 0])
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wbench
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Visic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.4.6
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Benchmark website loading times
|