feat: slow threshold customizable in zrpc (#1191)

* feat: slow threshold customizable in rest

* feat: slow threshold customizable in rest

* feat: slow threshold customizable in rest

* feat: slow threshold customizable in zrpc
This commit is contained in:
Kevin Wan
2021-11-01 15:04:38 +08:00
committed by GitHub
parent ebc90720ea
commit ba43214dae
9 changed files with 50 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"errors"
"testing"
"time"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
@@ -35,3 +36,9 @@ func TestDurationInterceptor(t *testing.T) {
})
}
}
func TestSetSlowThreshold(t *testing.T) {
assert.Equal(t, defaultSlowThreshold, slowThreshold.Load())
SetSlowThreshold(time.Second)
assert.Equal(t, time.Second, slowThreshold.Load())
}