statistics

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceMonitor

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

ResourceMonitor outputs statistics about resources used by the binary

func NewResourceMonitor

func NewResourceMonitor(file *os.File) (*ResourceMonitor, error)

NewResourceMonitor creates a new ResourceMonitor instance

func (*ResourceMonitor) Close

func (rm *ResourceMonitor) Close() error

Close closes the file used for statistics

func (*ResourceMonitor) GenerateStatistics

func (rm *ResourceMonitor) GenerateStatistics() string

GenerateStatistics creates a new statistic string

func (*ResourceMonitor) SaveStatistics

func (rm *ResourceMonitor) SaveStatistics() error

SaveStatistics generates and saves statistic data on the disk

type TpsBenchmark

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

TpsBenchmark will calculate statistics for the network activity

func NewTPSBenchmark

func NewTPSBenchmark(nrOfShards uint32, roundDuration uint64) (*TpsBenchmark, error)

NewTPSBenchmark instantiates a new object responsible with calculating statistics for each shard tps. nrOfShards represents the total number of shards, roundDuration is the duration for a round in seconds

func (*TpsBenchmark) ActiveNodes

func (s *TpsBenchmark) ActiveNodes() uint32

ActiveNodes returns the number of active nodes

func (*TpsBenchmark) AverageBlockTxCount

func (s *TpsBenchmark) AverageBlockTxCount() *big.Int

AverageBlockTxCount returns an average of the tx/block

func (*TpsBenchmark) BlockNumber

func (s *TpsBenchmark) BlockNumber() uint64

BlockNumber returns the last processed block number

func (*TpsBenchmark) LastBlockTxCount

func (s *TpsBenchmark) LastBlockTxCount() uint32

LastBlockTxCount returns the number of transactions processed in the last block

func (*TpsBenchmark) LiveTPS

func (s *TpsBenchmark) LiveTPS() float64

LiveTPS returns tps for the last block

func (*TpsBenchmark) NrOfShards

func (s *TpsBenchmark) NrOfShards() uint32

NrOfShards returns the number of shards

func (*TpsBenchmark) PeakTPS

func (s *TpsBenchmark) PeakTPS() float64

PeakTPS returns tps for the last block

func (*TpsBenchmark) RoundNumber

func (s *TpsBenchmark) RoundNumber() uint64

RoundNumber returns the round index for this benchmark object

func (*TpsBenchmark) RoundTime

func (s *TpsBenchmark) RoundTime() uint64

RoundTime returns the round duration in seconds

func (*TpsBenchmark) ShardStatistic

func (s *TpsBenchmark) ShardStatistic(shardID uint32) *shardStatistics

ShardStatistic returns the current statistical state for a given shard

func (*TpsBenchmark) ShardStatistics

func (s *TpsBenchmark) ShardStatistics() map[uint32]*shardStatistics

ShardStatistics returns the current statistical state for a given shard

func (*TpsBenchmark) TotalProcessedTxCount

func (s *TpsBenchmark) TotalProcessedTxCount() *big.Int

TotalProcessedTxCount returns the total number of processed transactions

func (*TpsBenchmark) Update

func (s *TpsBenchmark) Update(mb *block.MetaBlock)

Update receives a metablock and updates all fields accordingly for each shard available in the meta block

Jump to

Keyboard shortcuts

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