Documentation ¶
Index ¶
- type IntervalStatistics
- type Node
- func (n *Node) FailureDetectorInterceptor() grpc.UnaryServerInterceptor
- func (n *Node) PurgeInactiveClients(ctx context.Context, calcTimestamp time.Time)
- func (n *Node) ReceiveHeartbeat(ctx context.Context, clientID string, beatmsg *failproto.Beat) error
- func (n *Node) WatchConnectedNodes(ctx context.Context)
- type NodeMetadata
- type NodeOptions
- type PhiAccrualDetector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntervalStatistics ¶
type IntervalStatistics struct {
// contains filtered or unexported fields
}
IntervalStatistics - collection of stats for calculating phi (phi-accrual only, others tbd)
type Node ¶
type Node struct { RecentClients map[string]*PhiAccrualDetector // maps senderAddress -> detector // contains filtered or unexported fields }
Node - collection of health detectors for each client sending through the interceptor
func NewFailureDetectorNode ¶
func NewFailureDetectorNode(nOpts *NodeOptions, nMetadata *NodeMetadata) *Node
NewFailureDetectorNode - new failure-detecting node
func (*Node) FailureDetectorInterceptor ¶
func (n *Node) FailureDetectorInterceptor() grpc.UnaryServerInterceptor
FailureDetectorInterceptor - Acts as a UnaryServerInterceptor, updates detector node's heartbeat statistics when sees an incoming failproto.Beat message
func (*Node) PurgeInactiveClients ¶
PurgeNeighbors - calculates phi and removes processes that have been marked suspicious (using +inf as suspicion threshold) AND have not been seen within grace period.
func (*Node) ReceiveHeartbeat ¶
func (n *Node) ReceiveHeartbeat(ctx context.Context, clientID string, beatmsg *failproto.Beat) error
ReceiveHeartbeat - create or update a record in the node's RecentClients
func (*Node) WatchConnectedNodes ¶
WatchConnectedNodes - watches all connected clients, if the reap interval
type NodeMetadata ¶
NodeMetadata - metadata abt. the running grpc application for labeling published metrics
type NodeOptions ¶
type NodeOptions struct { EstimationWindowSize int ReapInterval time.Duration PurgeGracePeriod time.Duration }
NodeOptions - options for distribution estimation window, purging interval, etc.
type PhiAccrualDetector ¶
type PhiAccrualDetector struct {
// contains filtered or unexported fields
}
PhiAccrualDetector - detector for each client pinging the server
func NewPhiAccrualDetector ¶
func NewPhiAccrualDetector(hbTime time.Time, nOpts *NodeOptions, metadata *NodeMetadata) *PhiAccrualDetector
NewPhiAccrualDetector -