mcptestmon

package
v0.0.0-...-48a44ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryClientStatsContext

type InMemoryClientStatsContext struct {
	RequestAcksTotal         map[string]int64
	RequestNacksTotal        map[nackKey]int64
	SendFailuresTotal        map[errorCodeKey]int64
	RecvFailuresTotal        map[errorCodeKey]int64
	StreamCreateSuccessTotal int64
	// contains filtered or unexported fields
}

InMemoryClientStatsContext enables MCP client metric collection which is stored in memory for testing purposes.

func NewInMemoryClientStatsContext

func NewInMemoryClientStatsContext() *InMemoryClientStatsContext

NewInMemoryClientStatsContext creates a new context for tracking metrics in memory.

func (*InMemoryClientStatsContext) RecordRecvError

func (s *InMemoryClientStatsContext) RecordRecvError(err error, code codes.Code)

RecordRecvError records an error during a network recv with its error string and code.

func (*InMemoryClientStatsContext) RecordRequestAck

func (s *InMemoryClientStatsContext) RecordRequestAck(typeURL string)

RecordRequestAck records an ACK message for a type URL on a connection.

func (*InMemoryClientStatsContext) RecordRequestNack

func (s *InMemoryClientStatsContext) RecordRequestNack(typeURL string, err error)

RecordRequestNack records a NACK message for a type URL on a connection.

func (*InMemoryClientStatsContext) RecordSendError

func (s *InMemoryClientStatsContext) RecordSendError(err error, code codes.Code)

RecordSendError records an error during a network send with its error string and code.

func (*InMemoryClientStatsContext) RecordStreamCreateSuccess

func (s *InMemoryClientStatsContext) RecordStreamCreateSuccess()

RecordStreamCreateSuccess records a successful stream connection.

type InMemoryServerStatsContext

type InMemoryServerStatsContext struct {
	ClientsTotal      int64
	RequestSizesBytes map[requestKey][]int64
	RequestAcksTotal  map[requestKey]int64
	RequestNacksTotal map[requestKey]int64
	SendFailuresTotal map[errorCodeKey]int64
	RecvFailuresTotal map[errorCodeKey]int64
	// contains filtered or unexported fields
}

InMemoryServerStatsContext enables MCP server metric collection which is stored in memory for testing purposes.

func NewInMemoryServerStatsContext

func NewInMemoryServerStatsContext() *InMemoryServerStatsContext

NewInMemoryServerStatsContext creates a new context for tracking metrics in memory.

func (*InMemoryServerStatsContext) RecordRecvError

func (s *InMemoryServerStatsContext) RecordRecvError(err error, code codes.Code)

RecordRecvError records an error during a network recv with its error string and code.

func (*InMemoryServerStatsContext) RecordRequestAck

func (s *InMemoryServerStatsContext) RecordRequestAck(typeURL string, connectionID int64)

RecordRequestAck records an ACK message for a type URL on a connection.

func (*InMemoryServerStatsContext) RecordRequestNack

func (s *InMemoryServerStatsContext) RecordRequestNack(typeURL string, connectionID int64)

RecordRequestNack records a NACK message for a type URL on a connection.

func (*InMemoryServerStatsContext) RecordRequestSize

func (s *InMemoryServerStatsContext) RecordRequestSize(typeURL string, connectionID int64, size int)

RecordRequestSize records the size of a request from a connection for a specific type URL.

func (*InMemoryServerStatsContext) RecordSendError

func (s *InMemoryServerStatsContext) RecordSendError(err error, code codes.Code)

RecordSendError records an error during a network send with its error string and code.

func (*InMemoryServerStatsContext) SetClientsTotal

func (s *InMemoryServerStatsContext) SetClientsTotal(clients int64)

SetClientsTotal updates the current client count to the given argument.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL