models

package
v0.0.0-...-9f5e8be Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LatencyTracker

type LatencyTracker struct {
	// contains filtered or unexported fields
}

func (*LatencyTracker) GetMeasurementCount

func (l *LatencyTracker) GetMeasurementCount() float64

func (*LatencyTracker) GetP90Latency

func (l *LatencyTracker) GetP90Latency() float64

func (*LatencyTracker) RecordMeasurement

func (l *LatencyTracker) RecordMeasurement(time float64)

type QosNode

type QosNode struct {
	MorseNode      *models.Node
	MorseSession   *models.Session
	MorseSigner    *models.Ed25519Account
	LatencyTracker *LatencyTracker
	// contains filtered or unexported fields
}

QosNode a FAT model to store the QoS information of a specific node in a session.

func NewQosNode

func NewQosNode(morseNode *models.Node, pocketSession *models.Session, appSigner *models.Ed25519Account) *QosNode

func (*QosNode) GetAppStakeSigner

func (n *QosNode) GetAppStakeSigner() *models.Ed25519Account

func (*QosNode) GetChain

func (n *QosNode) GetChain() string

func (*QosNode) GetLastDataIntegrityCheckTime

func (n *QosNode) GetLastDataIntegrityCheckTime() time.Time

func (*QosNode) GetLastHeightCheckTime

func (n *QosNode) GetLastHeightCheckTime() time.Time

func (*QosNode) GetLastKnownErrorStr

func (n *QosNode) GetLastKnownErrorStr() string

func (*QosNode) GetLastKnownHeight

func (n *QosNode) GetLastKnownHeight() uint64

func (*QosNode) GetLatencyTracker

func (n *QosNode) GetLatencyTracker() *LatencyTracker

func (*QosNode) GetPublicKey

func (n *QosNode) GetPublicKey() string

func (*QosNode) GetTimeoutReason

func (n *QosNode) GetTimeoutReason() TimeoutReason

func (*QosNode) GetTimeoutUntil

func (n *QosNode) GetTimeoutUntil() time.Time

func (*QosNode) IsHealthy

func (n *QosNode) IsHealthy() bool

func (*QosNode) IsInTimeout

func (n *QosNode) IsInTimeout() bool

func (*QosNode) IsSynced

func (n *QosNode) IsSynced() bool

func (*QosNode) SetLastDataIntegrityCheckTime

func (n *QosNode) SetLastDataIntegrityCheckTime(lastDataIntegrityCheckTime time.Time)

func (*QosNode) SetLastHeightCheckTime

func (n *QosNode) SetLastHeightCheckTime(time time.Time)

func (*QosNode) SetLastKnownHeight

func (n *QosNode) SetLastKnownHeight(lastKnownHeight uint64)

func (*QosNode) SetSynced

func (n *QosNode) SetSynced(synced bool)

func (*QosNode) SetTimeoutUntil

func (n *QosNode) SetTimeoutUntil(time time.Time, reason TimeoutReason, attachedErr error)

type SessionChainKey

type SessionChainKey struct {
	SessionHeight uint   `json:"session_height"`
	Chain         string `json:"chain"`
}

type TimeoutReason

type TimeoutReason string
const (
	OutOfSyncTimeout     TimeoutReason = "out_of_sync_timeout"
	DataIntegrityTimeout TimeoutReason = "invalid_data_timeout"
	MaximumRelaysTimeout TimeoutReason = "maximum_relays_timeout"
	NodeResponseTimeout  TimeoutReason = "node_response_timeout"
)

Jump to

Keyboard shortcuts

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