go-zero/core/prof/profiler_test.go

24 lines
371 B
Go
Raw Normal View History

2020-12-27 14:45:14 +08:00
package prof
import (
"testing"
"github.com/zeromicro/go-zero/core/utils"
2020-12-27 14:45:14 +08:00
)
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(),
})
}