metrics

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, BSD-2-Clause Imports: 33 Imported by: 1

Documentation

Index

Constants

View Source
const PluginName = "Metrics"

PluginName is the name of the metrics plugin.

Variables

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

func BlockCountSinceStartPerComponentDashboard() map[ComponentType]uint64

BlockCountSinceStartPerComponentDashboard returns a map of block count per component types and their count since last time the value was read.

func BlockCountSinceStartPerComponentGrafana added in v0.9.2

func BlockCountSinceStartPerComponentGrafana() map[ComponentType]uint64

BlockCountSinceStartPerComponentGrafana returns a map of block count per component types and their count since the start of the node.

func BlockCountSinceStartPerPayload added in v0.9.2

func BlockCountSinceStartPerPayload() map[payload.Type]uint64

BlockCountSinceStartPerPayload returns a map of block payload types and their count since the start of the node.

func BlockFinalizationTotalTimeSinceIssuedPerType added in v0.9.2

func BlockFinalizationTotalTimeSinceIssuedPerType() map[BlockType]uint64

BlockFinalizationTotalTimeSinceIssuedPerType returns total time since block issuance it took for all blocks to finalize per block type.

func BlockFinalizationTotalTimeSinceReceivedPerType added in v0.9.2

func BlockFinalizationTotalTimeSinceReceivedPerType() map[BlockType]uint64

BlockFinalizationTotalTimeSinceReceivedPerType returns total time block received it took for all blocks to finalize per block type.

func BlockMissingCountDB added in v0.9.2

func BlockMissingCountDB() uint64

BlockMissingCountDB returns the number of blocks in missingBlockStore.

func BlockRequestQueueSize added in v0.9.2

func BlockRequestQueueSize() int64

BlockRequestQueueSize returns the number of block requests the node currently has registered.

func BlockTips added in v0.9.2

func BlockTips() uint64

BlockTips returns the actual number of tips in the block tangle.

func CPUUsage added in v0.2.0

func CPUUsage() float64

CPUUsage returns the current cpu usage.

func ConfirmedConflictCount added in v0.9.2

func ConfirmedConflictCount() uint64

ConfirmedConflictCount returns the number of confirmed conflicts.

func ConflictConfirmationTotalTime added in v0.9.2

func ConflictConfirmationTotalTime() uint64

ConflictConfirmationTotalTime returns total time it took for all confirmed conflicts to be confirmed.

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

func FinalizedBlockCountPerType() map[BlockType]uint64

FinalizedBlockCountPerType returns the number of blocks finalized per block type.

func FinalizedConflictCountDB added in v0.9.2

func FinalizedConflictCountDB() uint64

FinalizedConflictCountDB returns the number of non-confirmed conflicts.

func GossipInboundPackets added in v0.8.2

func GossipInboundPackets() uint64

GossipInboundPackets returns the total amount of inbound gossip packets.

func GossipOutboundPackets added in v0.8.2

func GossipOutboundPackets() uint64

GossipOutboundPackets returns the total amount of outbound gossip packets.

func InitialBlockCountPerComponentGrafana added in v0.9.2

func InitialBlockCountPerComponentGrafana() map[ComponentType]uint64

InitialBlockCountPerComponentGrafana returns a map of block count per component types and their count at the start of the node.

func InitialBlockMissingCountDB added in v0.9.2

func InitialBlockMissingCountDB() uint64

InitialBlockMissingCountDB returns the number of blocks in missingBlockStore at startup.

func InitialSchedulerTime added in v0.8.4

func InitialSchedulerTime() (result int64)

InitialSchedulerTime returns the cumulative time it took for all block to become scheduled at startup [milliseconds].

func InitialSumTimeSinceReceived added in v0.8.4

func InitialSumTimeSinceReceived() map[ComponentType]int64

InitialSumTimeSinceReceived returns the cumulative time it took for all block to be processed by each component since being received at startup [milliseconds].

func LastCommittedEpoch added in v0.9.2

func LastCommittedEpoch() *epoch.ECRecord

LastCommittedEpoch returns the last committed epoch.

func MemUsage added in v0.2.0

func MemUsage() uint64

MemUsage returns the current memory allocated as bytes.

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

func OwnRate() float64

func ParentCountPerType added in v0.8.0

func ParentCountPerType() map[tangleold.ParentsType]uint64

ParentCountPerType returns a map of parent counts per parent type.

func RateSetterBufferSize added in v0.9.1

func RateSetterBufferSize() int

RateSetterBufferSize number of ready blocks in the rate setter buffer.

func RateSetterEstimate added in v0.9.1

func RateSetterEstimate() int64

RateSetterEstimate returns the maximum buffer size.

func SchedulerBufferSize added in v0.8.4

func SchedulerBufferSize() int

SchedulerBufferSize number of bytes waiting to be scheduled.

func SchedulerDeficit added in v0.9.1

func SchedulerDeficit() float64

SchedulerDeficit local node's deficit value.

func SchedulerMaxBufferSize added in v0.8.4

func SchedulerMaxBufferSize() int

SchedulerMaxBufferSize returns the maximum buffer size.

func SchedulerNodeAManaAmount added in v0.8.4

func SchedulerNodeAManaAmount() map[string]float64

SchedulerNodeAManaAmount current aMana value for each node in the queue.

func SchedulerNodeQueueSizes added in v0.8.4

func SchedulerNodeQueueSizes() map[string]int

SchedulerNodeQueueSizes current size of each node's queue.

func SchedulerRate added in v0.8.4

func SchedulerRate() int64

SchedulerRate rate at which blocks are scheduled.

func SchedulerReadyBlocksCount added in v0.9.2

func SchedulerReadyBlocksCount() int

SchedulerReadyBlocksCount number of ready blocks in the scheduler buffer.

func SchedulerTime added in v0.8.4

func SchedulerTime() (result int64)

SchedulerTime returns the cumulative time it took for all block to become scheduled before startup [milliseconds].

func SchedulerTotalBufferBlocksCount added in v0.9.2

func SchedulerTotalBufferBlocksCount() int

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

func SolidificationRequests added in v0.8.4

func SolidificationRequests() uint64

SolidificationRequests returns the number of solidification requests since start of node.

func SumTimeSinceIssued added in v0.8.4

func SumTimeSinceIssued() map[ComponentType]int64

SumTimeSinceIssued returns the cumulative time it took for all block to be processed by each component since being issued [milliseconds].

func SumTimeSinceReceived added in v0.8.4

func SumTimeSinceReceived() map[ComponentType]int64

SumTimeSinceReceived returns the cumulative time it took for all block to be processed by each component since being received since startup [milliseconds].

func TangleTimeSynced added in v0.5.8

func TangleTimeSynced() bool

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

func TotalConflictCountDB added in v0.9.2

func TotalConflictCountDB() uint64

TotalConflictCountDB returns the total number of conflicts.

Types

type BlockType added in v0.9.2

type BlockType byte

BlockType defines the component for the different BPS metrics.

const (
	// DataBlock denotes data block type.
	DataBlock BlockType = iota
	// Transaction denotes transaction block.
	Transaction
)

func (BlockType) String added in v0.9.2

func (c BlockType) String() string

String returns the stringified component type.

type ComponentCounterUpdatedEvent added in v0.9.0

type ComponentCounterUpdatedEvent struct {
	ComponentStatus map[ComponentType]uint64
}

type ComponentType added in v0.4.0

type ComponentType byte

ComponentType defines the component for the different BPS metrics.

const (
	// Store denotes blocks stored by the block store.
	Store ComponentType = iota
	// Solidifier denotes blocks solidified by the solidifier.
	Solidifier
	// Scheduler denotes blocks scheduled by the scheduler.
	Scheduler
	// SchedulerDropped denotes blocks dropped by the scheduler.
	SchedulerDropped
	// SchedulerSkipped denotes confirmed blocks skipped by the scheduler.
	SchedulerSkipped
	// Booker denotes blocks 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 EventsStruct added in v0.9.0

type EventsStruct struct {
	// Fired when the blocks per second metric is updated.
	ReceivedBPSUpdated *event.Event[*ReceivedBPSUpdatedEvent]
	// Fired when the transactions per second metric is updated.
	ReceivedTPSUpdated *event.Event[*ReceivedTPSUpdatedEvent]
	// Fired when the component counter per second metric is updated.
	ComponentCounterUpdated *event.Event[*ComponentCounterUpdatedEvent]
	// RateSetterUpdated is fired when the rate setter metric is updated.
	RateSetterUpdated *event.Event[*RateSetterMetric]
}
var Events *EventsStruct

Events defines the events of the plugin.

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.

type RateSetterMetric added in v0.9.1

type RateSetterMetric struct {
	Size     int
	Estimate time.Duration
	Rate     float64
}

RateSetterMetric is the metric for the rate setter.

type ReceivedBPSUpdatedEvent added in v0.9.2

type ReceivedBPSUpdatedEvent struct {
	BPS uint64
}

type ReceivedTPSUpdatedEvent added in v0.9.0

type ReceivedTPSUpdatedEvent struct {
	TPS uint64
}

Jump to

Keyboard shortcuts

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