stats

package
v0.0.0-...-db344e9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcTPS

func CalcTPS(stats []*TxStats, blockInfoMap map[uint64]*BlockInfo) float64

func FetchBlockInfo

func FetchBlockInfo(ethclient *ethclient.Client, stats []*TxStats) (map[uint64]*BlockInfo, error)

func PrintBlockData

func PrintBlockData(blockInfoMap map[uint64]*BlockInfo)

func PrintFinalData

func PrintFinalData(tps float64, blockInfoMap map[uint64]*BlockInfo)

Types

type BlockInfo

type BlockInfo struct {
	BlockNum       uint64
	CreatedAt      uint64
	NumTxs         int
	GasUsed        uint64
	GasLimit       uint64
	GasUtilization float64
}

type CollectorData

type CollectorData struct {
	TPS       float64
	BlockInfo map[uint64]*BlockInfo
}

func GenerateStats

func GenerateStats(ethclient *ethclient.Client, txHashes []*types.Transaction, batchSize int) (*CollectorData, error)

type TxStats

type TxStats struct {
	TxHash string
	Block  uint64
}

func GatherTransactionReceipts

func GatherTransactionReceipts(ethclient *ethclient.Client, txs []*types.Transaction, batchSize int) ([]*TxStats, error)

Jump to

Keyboard shortcuts

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