dbtap 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/dbtap/tapper.rb +1 -1
- data/lib/dbtap/testers/performs_within.rb +17 -6
- data/lib/dbtap/testers/set_eq.rb +4 -3
- data/lib/dbtap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 039786803ec29d229e44f8a27dc6e9386f87487b
|
4
|
+
data.tar.gz: 9f5bcbd15573227c4b48ffc5aeebd197e533f198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9201218165072d47ff44998463ab82cb77b5d695595e55b9c0d0d695322b18cad5b71d38d3c8f3b0842565cb903360515c16d44804ae0002c7a5a5fba038c0b
|
7
|
+
data.tar.gz: cb952364207d30940c1b64322c360341d0b0ada7b46978dcb2819a1f9995e423d0a1d606ec03a88ec429a62a20ffc7e3c9e76e00b84da2213369ad361ed9419c
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 0.0.2 - 2014-08-20
|
5
|
+
|
6
|
+
### Added
|
7
|
+
- More details to `PerformsWithin#errors`
|
8
|
+
|
9
|
+
### Deprecated
|
10
|
+
- Nothing.
|
11
|
+
|
12
|
+
### Removed
|
13
|
+
- Nothing.
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
- PerformsWithin was comparing total time elapsed to average expected time/query.
|
17
|
+
|
18
|
+
|
4
19
|
## 0.0.1 - 2014-08-18
|
5
20
|
|
6
21
|
### Added
|
data/lib/dbtap/tapper.rb
CHANGED
@@ -37,7 +37,7 @@ module Dbtap
|
|
37
37
|
def not_ok(test, i)
|
38
38
|
message = "not ok #{i + 1}"
|
39
39
|
message += ' - ' + test.name if test.name
|
40
|
-
message += "\n " + test.errors.
|
40
|
+
message += "\n " + test.errors.join("\n ") if test.errors
|
41
41
|
puts message
|
42
42
|
end
|
43
43
|
|
@@ -22,20 +22,23 @@ module Dbtap
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def ok?
|
25
|
-
|
25
|
+
time_diff.abs.to_f <= delta
|
26
26
|
end
|
27
27
|
|
28
28
|
def errors
|
29
29
|
output = []
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
if time_diff < 0
|
31
|
+
output << "too slow by #{time_proportion}"
|
32
|
+
else
|
33
|
+
output << "too fast by #{time_proportion}"
|
34
|
+
end
|
35
|
+
output << "average runtime: #{elapsed_time} ms"
|
36
|
+
output << "desired average: #{expected_time} +/- #{delta} ms"
|
34
37
|
end
|
35
38
|
|
36
39
|
private
|
37
40
|
def elapsed_time
|
38
|
-
@elapsed_time ||= bench_it
|
41
|
+
@elapsed_time ||= bench_it / repetitions.to_f
|
39
42
|
end
|
40
43
|
|
41
44
|
def bench_it
|
@@ -49,5 +52,13 @@ module Dbtap
|
|
49
52
|
def repetitions
|
50
53
|
10
|
51
54
|
end
|
55
|
+
|
56
|
+
def time_diff
|
57
|
+
expected_time - elapsed_time
|
58
|
+
end
|
59
|
+
|
60
|
+
def time_proportion
|
61
|
+
elapsed_time.to_f / expected_time
|
62
|
+
end
|
52
63
|
end
|
53
64
|
end
|
data/lib/dbtap/testers/set_eq.rb
CHANGED
@@ -27,13 +27,14 @@ module Dbtap
|
|
27
27
|
def errors
|
28
28
|
output = []
|
29
29
|
unless missing.empty?
|
30
|
-
output << "Missing #{missing.count}/#{expected_count} Records
|
30
|
+
output << "Missing #{missing.count}/#{expected_count} Records:"
|
31
|
+
output << ' ' + missing.first.inspect
|
31
32
|
end
|
32
33
|
|
33
34
|
unless extras.empty?
|
34
|
-
output << "Extra #{extras.count} over #{expected_count} Records
|
35
|
+
output << "Extra #{extras.count} over #{expected_count} Records:"
|
36
|
+
output << ' ' + extras.first.inspect
|
35
37
|
end
|
36
|
-
output.join("\n")
|
37
38
|
end
|
38
39
|
|
39
40
|
private
|
data/lib/dbtap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbtap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Duryea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|