From a658e39c7c80066386021f4c171427e3c2e5d2bd Mon Sep 17 00:00:00 2001 From: Ella Pietraroia Date: Mon, 10 Feb 2020 12:11:20 +1030 Subject: [PATCH] filter: benchmark: move consts to into benchamrks --- filter/filter_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/filter/filter_test.go b/filter/filter_test.go index 3150128f..d8c62a01 100644 --- a/filter/filter_test.go +++ b/filter/filter_test.go @@ -69,6 +69,7 @@ func BenchmarkBasic(b *testing.B) { "testing" ) +<<<<<<< HEAD const ( outBasic = "testout/test_outBasic.mjpeg" outDiff = "testout/test_outDiff.mjpeg" @@ -103,6 +104,19 @@ func BenchmarkBasic(b *testing.B) { b.Log("\nFrames: ", len(testPackets)) >>>>>>> 60437c8c... filter: benchmark: upadte headers, add consts, print to log ======= +======= +type d struct { +} + +func (d *d) Write(p []byte) (int, error) { return len(p), nil } +func (d *d) Close() error { return nil } + +func BenchmarkBasic(b *testing.B) { + const BasicThreshold = 45000 + const BasicPixels = 1000 + buffer := &d{} + f := NewBasic(buffer, BasicThreshold, BasicPixels) +>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks b.Log("Frames: ", len(testPackets)) >>>>>>> 450df394... filter: benchmark: remove \n from log for n := 0; n < b.N; n++ { @@ -118,6 +132,9 @@ func BenchmarkBasic(b *testing.B) { func BenchmarkDifference(b *testing.B) { <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks const DiffThreshold = 3.0 buffer := &d{} f := NewDifference(buffer, DiffThreshold) @@ -160,6 +177,9 @@ func BenchmarkDifference(b *testing.B) { func BenchmarkKNN(b *testing.B) { <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks const motionDownscaling = 1 const motionInterval = 1 const KNNMinArea = 25.0 @@ -201,6 +221,9 @@ func BenchmarkKNN(b *testing.B) { func BenchmarkMOG(b *testing.B) { <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks const motionDownscaling = 1 const motionInterval = 1 const MOGMinArea = 25.0