Documentation ¶
Index ¶
- Constants
- Variables
- func AccessManaMap() mana.NodeMap
- func AccessPercentile() float64
- func AccessResearchManaMap() mana.NodeMap
- func AccessResearchPercentile() float64
- func AnalysisOutboundBytes() uint64
- func AutopeeringDistanceStats() (min, max uint64, avg float64)
- func AverageNeighborsAccess() float64
- func AverageNeighborsConsensus() float64
- func AveragePledgeAccess() mana.NodeMap
- func AveragePledgeConsensus() mana.NodeMap
- func AvgNeighborConnectionLifeTime() float64
- func BranchConfirmationTotalTime() uint64
- func CPUUsage() float64
- func ConfirmedBranchCount() uint64
- func ConsensusManaMap() mana.NodeMap
- func ConsensusPercentile() float64
- func ConsensusResearchManaMap() mana.NodeMap
- func ConsensusResearchPercentile() float64
- func DelegatedMana() uint64
- func FinalizedBranchCountDB() uint64
- func FinalizedMessageCountPerType() map[MessageType]uint64
- func GossipInboundPackets() uint64
- func GossipOutboundPackets() uint64
- func InitialMessageCountPerComponentGrafana() map[ComponentType]uint64
- func InitialMessageMissingCountDB() uint64
- func InitialSchedulerTime() (result int64)
- func InitialSumTimeSinceReceived() map[ComponentType]int64
- func MemUsage() uint64
- func MessageCountSinceStartPerComponentDashboard() map[ComponentType]uint64
- func MessageCountSinceStartPerComponentGrafana() map[ComponentType]uint64
- func MessageCountSinceStartPerPayload() map[payload.Type]uint64
- func MessageFinalizationTotalTimeSinceIssuedPerType() map[MessageType]uint64
- func MessageFinalizationTotalTimeSinceReceivedPerType() map[MessageType]uint64
- func MessageMissingCountDB() uint64
- func MessageRequestQueueSize() int64
- func MessageTips() uint64
- func NeighborConnectionsCount() uint64
- func NeighborDropCount() uint64
- func NetworkDiameter() int32
- func NodesMetrics() map[string]NodeInfo
- func OwnAccessResearchMana() float64
- func OwnConsensusMana() float64
- func OwnConsensusResearchMana() float64
- func ParentCountPerType() map[tangle.ParentsType]uint64
- func SchedulerBufferSize() int
- func SchedulerMaxBufferSize() int
- func SchedulerNodeAManaAmount() map[string]float64
- func SchedulerNodeQueueSizes() map[string]int
- func SchedulerRate() int64
- func SchedulerReadyMessagesCount() int
- func SchedulerTime() (result int64)
- func SchedulerTotalBufferMessagesCount() int
- func SolidificationRequests() uint64
- func SumTimeSinceIssued() map[ComponentType]int64
- func SumTimeSinceReceived() map[ComponentType]int64
- func TangleTimeSynced() bool
- func TotalBranchCountDB() uint64
- type ComponentType
- type MessageType
- type NodeInfo
- type NodePledgeMap
- type ParametersDefinition
- type PledgeLog
Constants ¶
const PluginName = "Metrics"
PluginName is the name of the metrics plugin.
Variables ¶
var Events = pluginEvents{ ReceivedMPSUpdated: events.NewEvent(uint64EventCaller), ReceivedTPSUpdated: events.NewEvent(uint64EventCaller), ComponentCounterUpdated: events.NewEvent(componentTypeUint64EventCaller), }
Events defines the events of the plugin.
var Parameters = &ParametersDefinition{}
Parameters contains the configuration used by the metrics plugin.
var ( // Plugin is the plugin instance of the metrics plugin. Plugin *node.Plugin )
Functions ¶
func AccessManaMap ¶
AccessManaMap returns the access mana of the whole network.
func AccessPercentile ¶
func AccessPercentile() float64
AccessPercentile returns the top percentile the node belongs to in terms of access mana holders.
func AccessResearchManaMap ¶
AccessResearchManaMap returns the access mana of the whole network, only taking ResearchAccess mana into account.
func AccessResearchPercentile ¶
func AccessResearchPercentile() float64
AccessResearchPercentile returns the top percentile the node belongs to in terms of access mana holders, only taking ResearchAccess mana into account.
func AnalysisOutboundBytes ¶
func AnalysisOutboundBytes() uint64
AnalysisOutboundBytes returns the total outbound analysis traffic.
func AutopeeringDistanceStats ¶
AutopeeringDistanceStats returns statistics of the autopeering distance function.
func AverageNeighborsAccess ¶
func AverageNeighborsAccess() float64
AverageNeighborsAccess returns the average access mana of the nodes neighbors.
func AverageNeighborsConsensus ¶
func AverageNeighborsConsensus() float64
AverageNeighborsConsensus returns the average consensus mana of the nodes neighbors.
func AveragePledgeAccess ¶
AveragePledgeAccess returns the average pledged access base mana of all nodes.
func AveragePledgeConsensus ¶
AveragePledgeConsensus returns the average pledged consensus base mana of all nodes.
func AvgNeighborConnectionLifeTime ¶
func AvgNeighborConnectionLifeTime() float64
AvgNeighborConnectionLifeTime return the average neighbor connection lifetime.
func BranchConfirmationTotalTime ¶
func BranchConfirmationTotalTime() uint64
BranchConfirmationTotalTime returns total time it took for all confirmed branches to be confirmed.
func ConfirmedBranchCount ¶
func ConfirmedBranchCount() uint64
ConfirmedBranchCount returns the number of confirmed branches.
func ConsensusManaMap ¶
ConsensusManaMap returns the consensus mana of the whole network.
func ConsensusPercentile ¶
func ConsensusPercentile() float64
ConsensusPercentile returns the top percentile the node belongs to in terms of consensus mana holders.
func ConsensusResearchManaMap ¶
ConsensusResearchManaMap returns the consensus mana of the whole network, only taking ResearchConsensus mana into account.
func ConsensusResearchPercentile ¶
func ConsensusResearchPercentile() float64
ConsensusResearchPercentile returns the top percentile the node belongs to in terms of consensus mana holders, only taking ResearchConsensus mana into account.
func DelegatedMana ¶
func DelegatedMana() uint64
DelegatedMana returns how much mana is currently delegated to the node.
func FinalizedBranchCountDB ¶
func FinalizedBranchCountDB() uint64
FinalizedBranchCountDB returns the number of non-confirmed branches.
func FinalizedMessageCountPerType ¶
func FinalizedMessageCountPerType() map[MessageType]uint64
FinalizedMessageCountPerType returns the number of messages finalized per message type.
func GossipInboundPackets ¶
func GossipInboundPackets() uint64
GossipInboundPackets returns the total amount of inbound gossip packets.
func GossipOutboundPackets ¶
func GossipOutboundPackets() uint64
GossipOutboundPackets returns the total amount of outbound gossip packets.
func InitialMessageCountPerComponentGrafana ¶
func InitialMessageCountPerComponentGrafana() map[ComponentType]uint64
InitialMessageCountPerComponentGrafana returns a map of message count per component types and their count at the start of the node.
func InitialMessageMissingCountDB ¶
func InitialMessageMissingCountDB() uint64
InitialMessageMissingCountDB returns the number of messages in missingMessageStore at startup.
func InitialSchedulerTime ¶
func InitialSchedulerTime() (result int64)
InitialSchedulerTime returns the cumulative time it took for all message to become scheduled at startup [milliseconds].
func InitialSumTimeSinceReceived ¶
func InitialSumTimeSinceReceived() map[ComponentType]int64
InitialSumTimeSinceReceived returns the cumulative time it took for all message to be processed by each component since being received at startup [milliseconds].
func MessageCountSinceStartPerComponentDashboard ¶
func MessageCountSinceStartPerComponentDashboard() map[ComponentType]uint64
MessageCountSinceStartPerComponentDashboard returns a map of message count per component types and their count since last time the value was read.
func MessageCountSinceStartPerComponentGrafana ¶
func MessageCountSinceStartPerComponentGrafana() map[ComponentType]uint64
MessageCountSinceStartPerComponentGrafana returns a map of message count per component types and their count since the start of the node.
func MessageCountSinceStartPerPayload ¶
MessageCountSinceStartPerPayload returns a map of message payload types and their count since the start of the node.
func MessageFinalizationTotalTimeSinceIssuedPerType ¶
func MessageFinalizationTotalTimeSinceIssuedPerType() map[MessageType]uint64
MessageFinalizationTotalTimeSinceIssuedPerType returns total time since message issuance it took for all messages to finalize per message type.
func MessageFinalizationTotalTimeSinceReceivedPerType ¶
func MessageFinalizationTotalTimeSinceReceivedPerType() map[MessageType]uint64
MessageFinalizationTotalTimeSinceReceivedPerType returns total time message received it took for all messages to finalize per message type.
func MessageMissingCountDB ¶
func MessageMissingCountDB() uint64
MessageMissingCountDB returns the number of messages in missingMessageStore.
func MessageRequestQueueSize ¶
func MessageRequestQueueSize() int64
MessageRequestQueueSize returns the number of message requests the node currently has registered.
func MessageTips ¶
func MessageTips() uint64
MessageTips returns the actual number of tips in the message tangle.
func NeighborConnectionsCount ¶
func NeighborConnectionsCount() uint64
NeighborConnectionsCount returns the neighbors connections count.
func NeighborDropCount ¶
func NeighborDropCount() uint64
NeighborDropCount returns the neighbor drop count.
func NetworkDiameter ¶
func NetworkDiameter() int32
NetworkDiameter returns the current network diameter.
func NodesMetrics ¶
NodesMetrics returns info about the OS, arch, number of cpu cores, cpu load and memory usage.
func OwnAccessResearchMana ¶
func OwnAccessResearchMana() float64
OwnAccessResearchMana returns the access mana of the node, only taking ResearchAccess mana into account.
func OwnConsensusMana ¶
func OwnConsensusMana() float64
OwnConsensusMana returns the consensus mana of the node.
func OwnConsensusResearchMana ¶
func OwnConsensusResearchMana() float64
OwnConsensusResearchMana returns the consensus mana of the node, only taking ResearchConsensus mana into account.
func ParentCountPerType ¶
func ParentCountPerType() map[tangle.ParentsType]uint64
ParentCountPerType returns a map of parent counts per parent type.
func SchedulerBufferSize ¶
func SchedulerBufferSize() int
SchedulerBufferSize number of bytes waiting to be scheduled.
func SchedulerMaxBufferSize ¶
func SchedulerMaxBufferSize() int
SchedulerMaxBufferSize returns if the node is synced based on tangle time.
func SchedulerNodeAManaAmount ¶
SchedulerNodeAManaAmount current aMana value for each node in the queue.
func SchedulerNodeQueueSizes ¶
SchedulerNodeQueueSizes current size of each node's queue.
func SchedulerReadyMessagesCount ¶
func SchedulerReadyMessagesCount() int
SchedulerReadyMessagesCount number of ready messages in the scheduler buffer.
func SchedulerTime ¶
func SchedulerTime() (result int64)
SchedulerTime returns the cumulative time it took for all message to become scheduled before startup [milliseconds].
func SchedulerTotalBufferMessagesCount ¶
func SchedulerTotalBufferMessagesCount() int
SchedulerTotalBufferMessagesCount returns if the node is synced based on tangle time.
func SolidificationRequests ¶
func SolidificationRequests() uint64
SolidificationRequests returns the number of solidification requests since start of node.
func SumTimeSinceIssued ¶
func SumTimeSinceIssued() map[ComponentType]int64
SumTimeSinceIssued returns the cumulative time it took for all message to be processed by each component since being issued [milliseconds].
func SumTimeSinceReceived ¶
func SumTimeSinceReceived() map[ComponentType]int64
SumTimeSinceReceived returns the cumulative time it took for all message to be processed by each component since being received since startup [milliseconds].
func TangleTimeSynced ¶
func TangleTimeSynced() bool
TangleTimeSynced returns if the node is synced based on tangle time.
func TotalBranchCountDB ¶
func TotalBranchCountDB() uint64
TotalBranchCountDB returns the total number of branches.
Types ¶
type ComponentType ¶
type ComponentType byte
ComponentType defines the component for the different MPS metrics.
const ( // Store denotes messages stored by the message store. Store ComponentType = iota // Solidifier denotes messages solidified by the solidifier. Solidifier // Scheduler denotes messages scheduled by the scheduler. Scheduler // SchedulerDropped denotes messages dropped by the scheduler. SchedulerDropped // SchedulerSkipped denotes confirmed messages skipped by the scheduler. SchedulerSkipped // Booker denotes messages booked by the booker. Booker )
func (ComponentType) String ¶
func (c ComponentType) String() string
String returns the stringified component type.
type MessageType ¶
type MessageType byte
MessageType defines the component for the different MPS metrics.
const ( // DataMessage denotes data message type. DataMessage MessageType = iota // Transaction denotes transaction message. Transaction )
func (MessageType) String ¶
func (c MessageType) String() string
String returns the stringified component type.
type NodeInfo ¶
type NodeInfo struct { OS string // Arch defines the system architecture of the node. Arch string // NumCPU defines number of logical cores of the node. NumCPU int // CPUUsage defines the CPU usage of the node. CPUUsage float64 // MemoryUsage defines the memory usage of the node. MemoryUsage uint64 }
NodeInfo holds info of a node.
type NodePledgeMap ¶
NodePledgeMap is a map of node and a list of mana pledges.
type ParametersDefinition ¶
type ParametersDefinition struct { // Local defines whether to collect local metrics. Local bool `default:"true" usage:"include local metrics"` // Global defines whether to collect global metrics. Global bool `default:"false" usage:"include global metrics"` // ManaUpdateInterval defines interval between mana metrics refreshes. ManaUpdateInterval time.Duration `default:"30s" usage:"mana metrics update interval"` // MetricsManaResearch defines whether to collect research mana metrics. ManaResearch bool `default:"false" usage:"include research mana metrics"` }
ParametersDefinition contains the definition of the parameters used by the metrics plugin.
type PledgeLog ¶
PledgeLog is a log of base mana 1 and 2 pledges.
func (*PledgeLog) AddConsensus ¶
AddConsensus logs the value of consensus pledge (base mana 1) pledged.
func (*PledgeLog) GetAccessAverage ¶
GetAccessAverage returns the average access mana pledge of a node.
func (*PledgeLog) GetConsensusAverage ¶
GetConsensusAverage returns the consensus mana pledged.