profiler_test.go 367 B

1234567891011121314151617181920212223
  1. package prof
  2. import (
  3. "testing"
  4. "git.i2edu.net/i2/go-zero/core/utils"
  5. )
  6. func TestProfiler(t *testing.T) {
  7. EnableProfiling()
  8. Start()
  9. Report("foo", ProfilePoint{
  10. ElapsedTimer: utils.NewElapsedTimer(),
  11. })
  12. }
  13. func TestNullProfiler(t *testing.T) {
  14. p := newNullProfiler()
  15. p.Start()
  16. p.Report("foo", ProfilePoint{
  17. ElapsedTimer: utils.NewElapsedTimer(),
  18. })
  19. }