You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
370 B
Go
24 lines
370 B
Go
4 years ago
|
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(),
|
||
|
})
|
||
|
}
|