From 73454cb9bc9e34219f84a4c361fa61d5a8e43a38 Mon Sep 17 00:00:00 2001 From: Ella Pietraroia Date: Fri, 7 Feb 2020 09:53:35 +1030 Subject: [PATCH] filter: benchmarks: tidying up code --- filter/filter_test.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/filter/filter_test.go b/filter/filter_test.go index 8c65b86a..dfa21cd5 100644 --- a/filter/filter_test.go +++ b/filter/filter_test.go @@ -22,18 +22,26 @@ LICENSE in gpl.txt. If not, see http://www.gnu.org/licenses. */ +<<<<<<< HEAD +======= +// To make a new file for testing please go to test repository test/test-data/av/input/motion-detection/byte_saver.go. + +>>>>>>> 749cfa17... filter: benchmarks: tidying up code package filter import ( "testing" ) +<<<<<<< HEAD type d struct { } func (d *d) Write(p []byte) (int, error) { return len(p), nil } func (d *d) Close() error { return nil } +======= +>>>>>>> 749cfa17... filter: benchmarks: tidying up code func BenchmarkBasic(b *testing.B) { <<<<<<< HEAD const BasicThreshold = 45000 @@ -45,8 +53,12 @@ func BenchmarkBasic(b *testing.B) { file, _ := os.Create("testout/test_outBasic.mjpeg") w := io.WriteCloser(file) f := NewBasic(w, false, 45000, 1000) +<<<<<<< HEAD fmt.Print("\nFrames: ", len(testPackets)) >>>>>>> 31ccc30a... benchmark testing file +======= + fmt.Print("\nFrames: ", len(testPackets), "\t") +>>>>>>> 749cfa17... filter: benchmarks: tidying up code for n := 0; n < b.N; n++ { for _, x := range testPackets { _, err := f.Write(x) @@ -73,7 +85,7 @@ func BenchmarkDifference(b *testing.B) { file, _ := os.Create("testout/test_outDiff.mjpeg") w := io.WriteCloser(file) f := NewDifference(w, false, 3) - fmt.Print("\nFrames: ", len(testPackets)) + fmt.Print("\nFrames: ", len(testPackets), "\t") for n := 0; n < b.N; n++ { for _, x := range testPackets { f.Write(x) @@ -97,8 +109,12 @@ func BenchmarkKNN(b *testing.B) { file, _ := os.Create("testout/test_outKNN.mjpeg") w := io.WriteCloser(file) f := NewKNN(w, 25, 20, 300, 9, false, 1, 1) +<<<<<<< HEAD fmt.Print("\nFrames: ", len(testPackets)) >>>>>>> 31ccc30a... benchmark testing file +======= + fmt.Print("\nFrames: ", len(testPackets), "\t") +>>>>>>> 749cfa17... filter: benchmarks: tidying up code for n := 0; n < b.N; n++ { for _, x := range testPackets { _, err := f.Write(x) @@ -123,8 +139,12 @@ func BenchmarkMOG(b *testing.B) { file, _ := os.Create("testout/test_outMOG.mjpeg") w := io.WriteCloser(file) f := NewMOG(w, 25, 20, 500, false, 1, 1) +<<<<<<< HEAD fmt.Print("\nFrames: ", len(testPackets)) >>>>>>> 31ccc30a... benchmark testing file +======= + fmt.Print("\nFrames: ", len(testPackets), "\t") +>>>>>>> 749cfa17... filter: benchmarks: tidying up code for n := 0; n < b.N; n++ { for _, x := range testPackets { _, err := f.Write(x)