metrics

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0, BSD-2-Clause Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const PluginName = "Metrics"

PluginName is the name of the metrics plugin.

Variables

View Source
var Events = pluginEvents{

	ReceivedMPSUpdated:      events.NewEvent(uint64EventCaller),
	ReceivedTPSUpdated:      events.NewEvent(uint64EventCaller),
	ComponentCounterUpdated: events.NewEvent(componentTypeUint64EventCaller),
}

Events defines the events of the plugin.

View Source
var Parameters = &ParametersDefinition{}

Parameters contains the configuration used by the metrics plugin.

View Source
var (
	// Plugin is the plugin instance of the metrics plugin.
	Plugin *node.Plugin
)

Functions

func AccessManaMap added in v0.5.0

func AccessManaMap() mana.NodeMap

AccessManaMap returns the access mana of the whole network.

func AccessPercentile added in v0.5.0

func AccessPercentile() float64

AccessPercentile returns the top percentile the node belongs to in terms of access mana holders.

func AccessResearchManaMap added in v0.5.0

func AccessResearchManaMap() mana.NodeMap

AccessResearchManaMap returns the access mana of the whole network, only taking ResearchAccess mana into account.

func AccessResearchPercentile added in v0.5.0

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 added in v0.2.0

func AnalysisOutboundBytes() uint64

AnalysisOutboundBytes returns the total outbound analysis traffic.

func AutopeeringDistanceStats added in v0.2.0

func AutopeeringDistanceStats() (min, max uint64, avg float64)

AutopeeringDistanceStats returns statistics of the autopeering distance function.

func AverageNeighborsAccess added in v0.5.0

func AverageNeighborsAccess() float64

AverageNeighborsAccess returns the average access mana of the nodes neighbors.

func AverageNeighborsConsensus added in v0.5.0

func AverageNeighborsConsensus() float64

AverageNeighborsConsensus returns the average consensus mana of the nodes neighbors.

func AveragePledgeAccess added in v0.5.0

func AveragePledgeAccess() mana.NodeMap

AveragePledgeAccess returns the average pledged access base mana of all nodes.

func AveragePledgeConsensus added in v0.5.0

func AveragePledgeConsensus() mana.NodeMap

AveragePledgeConsensus returns the average pledged consensus base mana of all nodes.

func AvgNeighborConnectionLifeTime added in v0.2.0

func AvgNeighborConnectionLifeTime() float64

AvgNeighborConnectionLifeTime return the average neighbor connection lifetime.

func BranchConfirmationTotalTime added in v0.8.0

func BranchConfirmationTotalTime() uint64

BranchConfirmationTotalTime returns total time it took for all confirmed branches to be confirmed.

func CPUUsage added in v0.2.0

func CPUUsage() float64

CPUUsage returns the current cpu usage.

func ConfirmedBranchCount added in v0.8.0

func ConfirmedBranchCount() uint64

ConfirmedBranchCount returns the number of confirmed branches.

func ConsensusManaMap added in v0.5.0

func ConsensusManaMap() mana.NodeMap

ConsensusManaMap returns the consensus mana of the whole network.

func ConsensusPercentile added in v0.5.0

func ConsensusPercentile() float64

ConsensusPercentile returns the top percentile the node belongs to in terms of consensus mana holders.

func ConsensusResearchManaMap added in v0.5.0

func ConsensusResearchManaMap() mana.NodeMap

ConsensusResearchManaMap returns the consensus mana of the whole network, only taking ResearchConsensus mana into account.

func ConsensusResearchPercentile added in v0.5.0

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 added in v0.6.0

func DelegatedMana() uint64

DelegatedMana returns how much mana is currently delegated to the node.

func FinalizedBranchCountDB added in v0.8.0

func FinalizedBranchCountDB() uint64

FinalizedBranchCountDB returns the number of non-confirmed branches.

func FinalizedMessageCountPerType added in v0.8.0

func FinalizedMessageCountPerType() map[MessageType]uint64

FinalizedMessageCountPerType returns the number of messages finalized per message type.

func GossipInboundBytes added in v0.2.0

func GossipInboundBytes() uint64

GossipInboundBytes returns the total inbound gossip traffic.

func GossipOutboundBytes added in v0.2.0

func GossipOutboundBytes() uint64

GossipOutboundBytes returns the total outbound gossip traffic.

func MemUsage added in v0.2.0

func MemUsage() uint64

MemUsage returns the current memory allocated as bytes.

func MessageCountSinceStartPerComponentDashboard added in v0.7.0

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 added in v0.7.0

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 added in v0.2.2

func MessageCountSinceStartPerPayload() map[payload.Type]uint64

MessageCountSinceStartPerPayload returns a map of message payload types and their count since the start of the node.

func MessageFinalizationTotalTimePerType added in v0.8.0

func MessageFinalizationTotalTimePerType() map[MessageType]uint64

MessageFinalizationTotalTimePerType returns total time it took for all messages to finalize per message type.

func MessageMissingCountDB added in v0.2.2

func MessageMissingCountDB() uint64

MessageMissingCountDB returns the number of messages in missingMessageStore.

func MessageRequestQueueSize added in v0.2.2

func MessageRequestQueueSize() int64

MessageRequestQueueSize returns the number of message requests the node currently has registered.

func MessageSolidCountDB added in v0.2.2

func MessageSolidCountDB() uint64

MessageSolidCountDB returns the number of messages that are solid in the DB.

func MessageTips added in v0.2.0

func MessageTips() uint64

MessageTips returns the actual number of tips in the message tangle.

func MessageTotalCountDB added in v0.2.2

func MessageTotalCountDB() uint64

MessageTotalCountDB returns the number of messages that are stored in the DB.

func MessageTotalCountSinceStart added in v0.2.2

func MessageTotalCountSinceStart() uint64

MessageTotalCountSinceStart returns the total number of messages seen since the start of the node.

func NeighborConnectionsCount added in v0.2.0

func NeighborConnectionsCount() uint64

NeighborConnectionsCount returns the neighbors connections count.

func NeighborDropCount added in v0.2.0

func NeighborDropCount() uint64

NeighborDropCount returns the neighbor drop count.

func NetworkDiameter added in v0.2.0

func NetworkDiameter() int32

NetworkDiameter returns the current network diameter.

func NodesMetrics added in v0.2.0

func NodesMetrics() map[string]NodeInfo

NodesMetrics returns info about the OS, arch, number of cpu cores, cpu load and memory usage.

func OwnAccessResearchMana added in v0.5.0

func OwnAccessResearchMana() float64

OwnAccessResearchMana returns the access mana of the node, only taking ResearchAccess mana into account.

func OwnConsensusMana added in v0.5.0

func OwnConsensusMana() float64

OwnConsensusMana returns the consensus mana of the node.

func OwnConsensusResearchMana added in v0.5.0

func OwnConsensusResearchMana() float64

OwnConsensusResearchMana returns the consensus mana of the node, only taking ResearchConsensus mana into account.

func ParentCountPerType added in v0.8.0

func ParentCountPerType() map[tangle.ParentsType]uint64

ParentCountPerType returns a map of parent counts per parent type.

func ReceivedMessagesPerSecond added in v0.2.0

func ReceivedMessagesPerSecond() uint64

ReceivedMessagesPerSecond retrieves the current messages per second number.

func SolidificationTime added in v0.8.0

func SolidificationTime() (result int64)

SolidificationTime returns the cumulative time it took for all message to become solid [milliseconds].

func TangleTimeSynced added in v0.5.8

func TangleTimeSynced() bool

TangleTimeSynced returns if the node is synced based on tangle time.

func TotalBranchCountDB added in v0.8.0

func TotalBranchCountDB() uint64

TotalBranchCountDB returns the total number of branches.

Types

type ComponentType added in v0.4.0

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
	// Booker denotes messages booked by the booker.
	Booker
)

func (ComponentType) String added in v0.4.0

func (c ComponentType) String() string

String returns the stringified component type.

type MessageType added in v0.8.0

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 added in v0.8.0

func (c MessageType) String() string

String returns the stringified component type.

type NodeInfo added in v0.2.0

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 added in v0.5.0

type NodePledgeMap map[identity.ID]*PledgeLog

NodePledgeMap is a map of node and a list of mana pledges.

type ParametersDefinition added in v0.7.4

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 added in v0.5.0

type PledgeLog struct {
	AccessPledges    []float64
	ConsensusPledges []float64
}

PledgeLog is a log of base mana 1 and 2 pledges.

func (*PledgeLog) AddAccess added in v0.5.0

func (p *PledgeLog) AddAccess(val float64)

AddAccess logs the value of access pledge (base mana 2) pledged.

func (*PledgeLog) AddConsensus added in v0.5.0

func (p *PledgeLog) AddConsensus(val float64)

AddConsensus logs the value of consensus pledge (base mana 1) pledged.

func (*PledgeLog) GetAccessAverage added in v0.5.0

func (p *PledgeLog) GetAccessAverage() float64

GetAccessAverage returns the average access mana pledge of a node.

func (*PledgeLog) GetConsensusAverage added in v0.5.0

func (p *PledgeLog) GetConsensusAverage() float64

GetConsensusAverage returns the consensus mana pledged.

Jump to

Keyboard shortcuts

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