Add unit tests

This commit is contained in:
Mayuresh Gaitonde
2020-12-17 17:25:53 -08:00
parent 3702339f44
commit 6be4d69d02
705 changed files with 120529 additions and 150051 deletions

View File

@@ -19,9 +19,8 @@
package stats
import (
"context"
"net"
"golang.org/x/net/context"
)
// ConnTagInfo defines the relevant information needed by connection context tagger.

View File

@@ -24,10 +24,11 @@
package stats // import "google.golang.org/grpc/stats"
import (
"context"
"net"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/metadata"
)
// RPCStats contains stats information about RPCs.
@@ -90,6 +91,8 @@ type InHeader struct {
LocalAddr net.Addr
// Compression is the compression algorithm used for the RPC.
Compression string
// Header contains the header metadata received.
Header metadata.MD
}
// IsClient indicates if the stats information is from client side.
@@ -103,6 +106,9 @@ type InTrailer struct {
Client bool
// WireLength is the wire length of trailer.
WireLength int
// Trailer contains the trailer metadata received from the server. This
// field is only valid if this InTrailer is from the client side.
Trailer metadata.MD
}
// IsClient indicates if the stats information is from client side.
@@ -145,6 +151,8 @@ type OutHeader struct {
LocalAddr net.Addr
// Compression is the compression algorithm used for the RPC.
Compression string
// Header contains the header metadata sent.
Header metadata.MD
}
// IsClient indicates if this stats information is from client side.
@@ -158,6 +166,9 @@ type OutTrailer struct {
Client bool
// WireLength is the wire length of trailer.
WireLength int
// Trailer contains the trailer metadata sent to the client. This
// field is only valid if this OutTrailer is from the server side.
Trailer metadata.MD
}
// IsClient indicates if this stats information is from client side.
@@ -173,6 +184,10 @@ type End struct {
BeginTime time.Time
// EndTime is the time when the RPC ends.
EndTime time.Time
// Trailer contains the trailer metadata received from the server. This
// field is only valid if this End is from the client side.
// Deprecated: use Trailer in InTrailer instead.
Trailer metadata.MD
// Error is the error the RPC ended with. It is an error generated from
// status.Status and can be converted back to status.Status using
// status.FromError if non-nil.