Adds ability to parse benchmarking information, and (optional) with memory information and with -count specified. Includes a number of unit tests. Issue #70.

This commit is contained in:
Brittany Walentin
2018-05-22 19:20:43 -07:00
parent 1ce4b93a20
commit b2f467b67c
16 changed files with 566 additions and 4 deletions

7
testdata/22-bench.txt vendored Normal file
View File

@ -0,0 +1,7 @@
goos: darwin
goarch: amd64
pkg: code.internal/state
BenchmarkParse-8 2000000 604 ns/op
BenchmarkReadingList-8 1000000 1425 ns/op
PASS
ok package/basic 3.212s

10
testdata/22-report.xml vendored Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="2" failures="0" time="3.212" name="package/basic">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="basic" name="BenchmarkParse" time="0.000000604"></testcase>
<testcase classname="basic" name="BenchmarkReadingList" time="0.000001425"></testcase>
</testsuite>
</testsuites>

7
testdata/23-benchmem.txt vendored Normal file
View File

@ -0,0 +1,7 @@
goos: darwin
goarch: amd64
pkg: code.internal/state
BenchmarkIpsHistoryInsert-8 30000 52568 ns/op 24879 B/op 494 allocs/op
BenchmarkIpsHistoryLookup-8 100000 15208 ns/op 7369 B/op 143 allocs/op
PASS
ok package/one 9.415s

10
testdata/23-report.xml vendored Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="2" failures="0" time="9.415" name="package/one">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="one" name="BenchmarkIpsHistoryInsert" time="0.000052568" bytes="24879" allocs="494"></testcase>
<testcase classname="one" name="BenchmarkIpsHistoryLookup" time="0.000015208" bytes="7369" allocs="143"></testcase>
</testsuite>
</testsuites>

15
testdata/24-benchtests.txt vendored Normal file
View File

@ -0,0 +1,15 @@
=== RUN TestNew
=== RUN TestNew/no
=== RUN TestNew/normal
--- PASS: TestNew (0.00s)
--- PASS: TestNew/no (0.00s)
--- PASS: TestNew/normal (0.00s)
=== RUN TestWriteThis
--- PASS: TestWriteThis (0.00s)
goos: darwin
goarch: amd64
pkg: package3/baz
BenchmarkDeepMerge-8 500000 2611 ns/op 1110 B/op 16 allocs/op
BenchmarkNext-8 500000 100 ns/op 100 B/op 1 allocs/op
PASS
ok package3/baz 1.382s

14
testdata/24-report.xml vendored Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="6" failures="0" time="1.382" name="package3/baz">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="baz" name="TestNew" time="0.000"></testcase>
<testcase classname="baz" name="TestNew/no" time="0.000"></testcase>
<testcase classname="baz" name="TestNew/normal" time="0.000"></testcase>
<testcase classname="baz" name="TestWriteThis" time="0.000"></testcase>
<testcase classname="baz" name="BenchmarkDeepMerge" time="0.000002611" bytes="1110" allocs="16"></testcase>
<testcase classname="baz" name="BenchmarkNext" time="0.000000100" bytes="100" allocs="1"></testcase>
</testsuite>
</testsuites>

12
testdata/25-benchcount.txt vendored Normal file
View File

@ -0,0 +1,12 @@
BenchmarkNew-8 5000000 350 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 357 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 354 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 358 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 345 ns/op 80 B/op 3 allocs/op
BenchmarkFew-8 5000000 100 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 105 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 102 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 102 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 102 ns/op 20 B/op 1 allocs/op
PASS
ok pkg/count 14.211s

10
testdata/25-report.xml vendored Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="2" failures="0" time="14.211" name="pkg/count">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="count" name="BenchmarkNew" time="0.000000352" bytes="80" allocs="3"></testcase>
<testcase classname="count" name="BenchmarkFew" time="0.000000102" bytes="20" allocs="1"></testcase>
</testsuite>
</testsuites>

15
testdata/26-report.xml vendored Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="7" failures="0" time="14.211" name="multiple/repeating">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="repeating" name="TestRepeat" time="0.000"></testcase>
<testcase classname="repeating" name="TestRepeat" time="0.000"></testcase>
<testcase classname="repeating" name="TestRepeat" time="0.000"></testcase>
<testcase classname="repeating" name="TestRepeat" time="0.000"></testcase>
<testcase classname="repeating" name="TestRepeat" time="0.000"></testcase>
<testcase classname="repeating" name="BenchmarkNew" time="0.000000352" bytes="80" allocs="3"></testcase>
<testcase classname="repeating" name="BenchmarkFew" time="0.000000102" bytes="20" allocs="1"></testcase>
</testsuite>
</testsuites>

23
testdata/26-testbenchmultiple.txt vendored Normal file
View File

@ -0,0 +1,23 @@
=== RUN TestRepeat
--- PASS: TestRepeat (0.00s)
=== RUN TestRepeat
--- PASS: TestRepeat (0.00s)
=== RUN TestRepeat
--- PASS: TestRepeat (0.00s)
=== RUN TestRepeat
--- PASS: TestRepeat (0.00s)
=== RUN TestRepeat
--- PASS: TestRepeat (0.00s)
pkg: multiple/repeating
BenchmarkNew-8 5000000 350 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 357 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 354 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 358 ns/op 80 B/op 3 allocs/op
BenchmarkNew-8 5000000 345 ns/op 80 B/op 3 allocs/op
BenchmarkFew-8 5000000 100 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 105 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 102 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 102 ns/op 20 B/op 1 allocs/op
BenchmarkFew-8 5000000 102 ns/op 20 B/op 1 allocs/op
PASS
ok multiple/repeating 14.211s

8
testdata/27-benchdecimal.txt vendored Normal file
View File

@ -0,0 +1,8 @@
goos: darwin
goarch: amd64
pkg: really/small
BenchmarkItsy-8 30000000 45.7 ns/op
BenchmarkTeeny-8 1000000000 2.12 ns/op
BenchmarkWeeny-8 2000000000 0.26 ns/op
PASS
ok really/small 4.344s

11
testdata/27-report.xml vendored Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="3" failures="0" time="4.344" name="really/small">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="small" name="BenchmarkItsy" time="0.000000045"></testcase>
<testcase classname="small" name="BenchmarkTeeny" time="0.000000002"></testcase>
<testcase classname="small" name="BenchmarkWeeny" time="0.000000000"></testcase>
</testsuite>
</testsuites>