add more tests for prof (#322)

This commit is contained in:
Kevin Wan
2020-12-27 14:45:14 +08:00
committed by GitHub
parent 8df7de94e3
commit 71a2b20301
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package prof
import (
"testing"
"github.com/tal-tech/go-zero/core/utils"
)
func TestProfiler(t *testing.T) {
EnableProfiling()
Start()
Report("foo", ProfilePoint{
ElapsedTimer: utils.NewElapsedTimer(),
})
}
func TestNullProfiler(t *testing.T) {
p := newNullProfiler()
p.Start()
p.Report("foo", ProfilePoint{
ElapsedTimer: utils.NewElapsedTimer(),
})
}