vochaininfo

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: AGPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// VochainHeight ...
	VochainHeight = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "height",
		Help:      "Height of the vochain (last block)",
	})
	// VochainMempool ...
	VochainMempool = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "mempool",
		Help:      "Number of Txs in the mempool",
	})
	// VochainAppTree ...
	VochainAppTree = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "app_tree",
		Help:      "Size of the app tree",
	})
	// VochainProcessTree ...
	VochainProcessTree = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "process_tree",
		Help:      "Size of the process tree",
	})
	// VochainVoteTree ...
	VochainVoteTree = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "vote_tree",
		Help:      "Size of the vote tree",
	})
	// VochainVotesPerMinute ...
	VochainVotesPerMinute = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "vote_tree_increase_last_minute",
		Help:      "Number of votes included in the vote tree the last 60 seconds",
	})
	// VochainAppTree ...
	VochainVoteCache = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "vochain",
		Name:      "vote_cache",
		Help:      "Size of the current vote cache",
	})
)

Vochain collectors

Functions

This section is empty.

Types

type VochainInfo

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

VochainInfo stores some metrics and information regarding the Vochain Blockchain Avg1/10/60/360 are the block time average for 1 minute, 10 minutes, 1 hour and 6 hours

func NewVochainInfo

func NewVochainInfo(node *vochain.BaseApplication) *VochainInfo

NewVochainInfo creates a new VochainInfo type

func (*VochainInfo) BlockTimes

func (vi *VochainInfo) BlockTimes() *[5]int32

BlockTimes returns the average block time for 1, 10, 60, 360 and 1440 minutes Value 0 means there is not yet an average

func (*VochainInfo) Close

func (vi *VochainInfo) Close()

Close stops all started goroutines of VochainInfo

func (*VochainInfo) CollectMetrics

func (vi *VochainInfo) CollectMetrics(ma *metrics.Agent)

CollectMetrics constantly updates the metric values for prometheus The function is blocking, should be called in a go routine If the metrics Agent is nil, do nothing

func (*VochainInfo) Height

func (vi *VochainInfo) Height() int64

Height returns the current number of blocks of the blockchain

func (*VochainInfo) MempoolSize

func (vi *VochainInfo) MempoolSize() int

MempoolSize returns the current number of transactions waiting to be validated

func (*VochainInfo) Peers

func (vi *VochainInfo) Peers() (peers []string)

Peers returns the current list of connected peers

func (*VochainInfo) Start

func (vi *VochainInfo) Start(sleepSecs int64)

Start initializes the Vochain statistics recollection

func (*VochainInfo) Sync

func (vi *VochainInfo) Sync() bool

Sync returns true if the Vochain is considered up-to-date Disclaimer: this method is not 100% accurated. Use it just for non-critical operations

func (*VochainInfo) TreeSizes

func (vi *VochainInfo) TreeSizes() (uint64, uint64, int)

TreeSizes returns the current size of the ProcessTree, VoteTree and the votes per minute ProcessTree: total number of created voting processes in the blockchain VoteTree: total number of votes registered in the blockchain VotesPerMinute: number of votes included in the last 60 seconds

func (*VochainInfo) VoteCacheSize

func (vi *VochainInfo) VoteCacheSize() int

VoteCacheSize returns the current number of validated votes waiting to be included in the blockchain

Jump to

Keyboard shortcuts

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