Documentation ¶
Index ¶
- type ClientStats
- type ClientStatsReadOnly
- type MockClient
- type MockServer
- type Records
- type ServerStats
- func (s *ServerStats) ActiveConnection()
- func (s *ServerStats) CloseConnection()
- func (s *ServerStats) ConnectionActive() uint32
- func (s *ServerStats) ConnectionClosed() uint32
- func (s *ServerStats) ConnectionTotal() uint32
- func (s *ServerStats) Records() *Records
- func (s *ServerStats) Requests() uint32
- func (s *ServerStats) ResponseInfo() (map[int16]uint32, uint32)
- func (s *ServerStats) String() string
- type ServerStatsReadOnly
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientStats ¶
type ClientStats struct { *ServerStats // contains filtered or unexported fields }
func NewClientStats ¶
func NewClientStats() *ClientStats
func (*ClientStats) ExpectedResponseCount ¶
func (c *ClientStats) ExpectedResponseCount() uint32
func (*ClientStats) Response ¶
func (c *ClientStats) Response(expected bool)
func (*ClientStats) String ¶
func (c *ClientStats) String() string
func (*ClientStats) UnexpectedResponseCount ¶
func (c *ClientStats) UnexpectedResponseCount() uint32
type ClientStatsReadOnly ¶
type ClientStatsReadOnly interface { ServerStatsReadOnly ExpectedResponseCount() uint32 UnexpectedResponseCount() uint32 }
type MockClient ¶
type MockClient interface { // SyncCall sends a sync request, if returns true means request receives expected response. SyncCall() bool // AsyncCall sends a request but not wait for responses. AsyncCall() // Stats returns client metrics. If AsyncCall is called, use metrics to check results. Stats() ClientStatsReadOnly // Close closes all client connections Close() }
MockClient mocks a downstream client
type MockServer ¶
type MockServer interface { // Start runs a mock server Start() // Close stops a mock server Stop() // Stats returns a ServerStats Stats() ServerStatsReadOnly }
MockServer mocks a upstream server for mosn test
type Records ¶
type Records struct {
// contains filtered or unexported fields
}
func NewRecords ¶
func NewRecords() *Records
func (*Records) RecordRequest ¶
func (r *Records) RecordRequest()
func (*Records) RecordResponse ¶
records response info, notice not all request will send response
type ServerStats ¶
type ServerStats struct {
// contains filtered or unexported fields
}
func NewServerStats ¶
func NewServerStats() *ServerStats
func (*ServerStats) ActiveConnection ¶
func (s *ServerStats) ActiveConnection()
func (*ServerStats) CloseConnection ¶
func (s *ServerStats) CloseConnection()
func (*ServerStats) ConnectionActive ¶
func (s *ServerStats) ConnectionActive() uint32
func (*ServerStats) ConnectionClosed ¶
func (s *ServerStats) ConnectionClosed() uint32
func (*ServerStats) ConnectionTotal ¶
func (s *ServerStats) ConnectionTotal() uint32
func (*ServerStats) Records ¶
func (s *ServerStats) Records() *Records
func (*ServerStats) Requests ¶
func (s *ServerStats) Requests() uint32
func (*ServerStats) ResponseInfo ¶
func (s *ServerStats) ResponseInfo() (map[int16]uint32, uint32)
func (*ServerStats) String ¶
func (s *ServerStats) String() string
Click to show internal directories.
Click to hide internal directories.