package relaytest
import "github.com/uber/tchannel-go/relay/relaytest"
Index ¶
- type FluentMockCallStats
- func (f *FluentMockCallStats) Failed(reason string) *FluentMockCallStats
- func (f *FluentMockCallStats) SetPeer(peer relay.Peer) *FluentMockCallStats
- func (f *FluentMockCallStats) Succeeded() *FluentMockCallStats
- type MockCallStats
- func (m *MockCallStats) End()
- func (m *MockCallStats) Failed(reason string)
- func (m *MockCallStats) SetPeer(peer relay.Peer)
- func (m *MockCallStats) Succeeded()
- type MockStats
Types ¶
type FluentMockCallStats ¶
type FluentMockCallStats struct { *MockCallStats }
FluentMockCallStats wraps the MockCallStats in a fluent API that's convenient for tests.
func (*FluentMockCallStats) Failed ¶
func (f *FluentMockCallStats) Failed(reason string) *FluentMockCallStats
Failed marks the RPC as failed.
func (*FluentMockCallStats) SetPeer ¶
func (f *FluentMockCallStats) SetPeer(peer relay.Peer) *FluentMockCallStats
SetPeer sets the peer for the current call.
func (*FluentMockCallStats) Succeeded ¶
func (f *FluentMockCallStats) Succeeded() *FluentMockCallStats
Succeeded marks the RPC as succeeded.
type MockCallStats ¶
type MockCallStats struct {
// contains filtered or unexported fields
}
MockCallStats is a testing spy for the CallStats interface.
func (*MockCallStats) End ¶
func (m *MockCallStats) End()
End halts timer and metric collection for the RPC.
func (*MockCallStats) Failed ¶
func (m *MockCallStats) Failed(reason string)
Failed marks the RPC as failed for the provided reason.
func (*MockCallStats) SetPeer ¶
func (m *MockCallStats) SetPeer(peer relay.Peer)
SetPeer sets the peer for the current call.
func (*MockCallStats) Succeeded ¶
func (m *MockCallStats) Succeeded()
Succeeded marks the RPC as succeeded.
type MockStats ¶
type MockStats struct {
// contains filtered or unexported fields
}
MockStats is a testing spy for the Stats interface.
func NewMockStats ¶
func NewMockStats() *MockStats
NewMockStats constructs a MockStats.
func (*MockStats) Add ¶
func (m *MockStats) Add(caller, callee, procedure string) *FluentMockCallStats
Add explicitly adds a new call along an edge of the call graph.
func (*MockStats) AssertEqual ¶
AssertEqual asserts that two MockStats describe the same call graph.
func (*MockStats) Begin ¶
Begin starts collecting metrics for an RPC.
Source Files ¶
- Version
- v1.0.9
- Published
- Jul 21, 2016
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 9 hours ago –
Tools for package owners.