rename prommetric to prometheous, add unit tests

This commit is contained in:
kevin
2020-09-27 16:14:16 +08:00
parent 015716d1b5
commit a958400595
11 changed files with 119 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ var (
})
)
func UnaryPromMetricInterceptor() grpc.UnaryServerInterceptor {
func UnaryPrometheousInterceptor() grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (
interface{}, error) {
startTime := timex.Now()

View File

@@ -9,7 +9,7 @@ import (
)
func TestUnaryPromMetricInterceptor(t *testing.T) {
interceptor := UnaryPromMetricInterceptor()
interceptor := UnaryPrometheousInterceptor()
_, err := interceptor(context.Background(), nil, &grpc.UnaryServerInfo{
FullMethod: "/",
}, func(ctx context.Context, req interface{}) (interface{}, error) {