mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 08:29:58 +08:00
19 lines
373 B
Go
19 lines
373 B
Go
|
|
package mon
|
||
|
|
|
||
|
|
import (
|
||
|
|
"testing"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
"github.com/stretchr/testify/assert"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestSetSlowThreshold(t *testing.T) {
|
||
|
|
assert.Equal(t, defaultSlowThreshold, slowThreshold.Load())
|
||
|
|
SetSlowThreshold(time.Second)
|
||
|
|
assert.Equal(t, time.Second, slowThreshold.Load())
|
||
|
|
}
|
||
|
|
|
||
|
|
func TestDefaultOptions(t *testing.T) {
|
||
|
|
assert.Equal(t, defaultTimeout, defaultOptions().timeout)
|
||
|
|
}
|