mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 17:52:49 +08:00
24 lines
370 B
Go
24 lines
370 B
Go
|
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(),
|
||
|
})
|
||
|
}
|