stats

package
v0.76.0-preview.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchain

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

Blockchain hold stats over all the vega node.

func NewBlockchain

func NewBlockchain() *Blockchain

NewBlockchain instantiate a new Blockchain.

func (*Blockchain) AddCurrentTradesInBatch

func (b *Blockchain) AddCurrentTradesInBatch(i uint64)

func (*Blockchain) AddTotalAmendOrder

func (b *Blockchain) AddTotalAmendOrder(val uint64) uint64

func (*Blockchain) AddTotalCancelOrder

func (b *Blockchain) AddTotalCancelOrder(val uint64) uint64

func (*Blockchain) AddTotalCreateOrder

func (b *Blockchain) AddTotalCreateOrder(val uint64) uint64

AddTotalCreateOrder - increment total created orders.

func (*Blockchain) AddTotalOrders

func (b *Blockchain) AddTotalOrders(val uint64) uint64

AddTotalOrders increment total orders.

func (*Blockchain) AddTotalTrades

func (b *Blockchain) AddTotalTrades(val uint64) uint64

AddTotalTrades increment total trades.

func (Blockchain) AverageOrdersPerBatch

func (b Blockchain) AverageOrdersPerBatch() uint64

AverageOrdersPerBatch returns the average number of orders accepted per blocks.

func (*Blockchain) AverageTxPerBatch

func (b *Blockchain) AverageTxPerBatch() uint64

AverageTxPerBatch return the average number of transaction per block.

func (*Blockchain) AverageTxSizeBytes

func (b *Blockchain) AverageTxSizeBytes() uint64

AverageTxSizeBytes return the average size in bytes of the transaction sent to vega.

func (Blockchain) BlockDuration

func (b Blockchain) BlockDuration() uint64

BlockDuration return the duration it took to generate the last block.

func (Blockchain) CurrentEventsInBatch added in v0.68.0

func (b Blockchain) CurrentEventsInBatch() uint64

func (Blockchain) CurrentOrdersInBatch

func (b Blockchain) CurrentOrdersInBatch() uint64

func (Blockchain) CurrentTradesInBatch

func (b Blockchain) CurrentTradesInBatch() uint64

func (*Blockchain) EventsPerSecond added in v0.68.0

func (b *Blockchain) EventsPerSecond() uint64

func (Blockchain) Hash

func (b Blockchain) Hash() string

func (Blockchain) Height

func (b Blockchain) Height() uint64

Height returns the current heights of the chain.

func (*Blockchain) IncCurrentOrdersInBatch

func (b *Blockchain) IncCurrentOrdersInBatch()

func (*Blockchain) IncHeight

func (b *Blockchain) IncHeight()

IncHeight increment the height of the chain.

func (*Blockchain) IncTotalAmendOrder

func (b *Blockchain) IncTotalAmendOrder()

func (*Blockchain) IncTotalBatches

func (b *Blockchain) IncTotalBatches()

IncTotalBatches increment total batches.

func (*Blockchain) IncTotalCancelOrder

func (b *Blockchain) IncTotalCancelOrder()

func (*Blockchain) IncTotalCreateOrder

func (b *Blockchain) IncTotalCreateOrder()

func (*Blockchain) IncTotalOrders

func (b *Blockchain) IncTotalOrders()

func (*Blockchain) IncTotalTxCurrentBatch

func (b *Blockchain) IncTotalTxCurrentBatch()

func (*Blockchain) IncrementEventCount added in v0.68.0

func (b *Blockchain) IncrementEventCount(count uint64)

func (*Blockchain) NewBatch

func (b *Blockchain) NewBatch()

func (Blockchain) OrdersPerSecond

func (b Blockchain) OrdersPerSecond() uint64

OrdersPerSecond return the total number of orders processed during the last second.

func (*Blockchain) ResetBatchTotals

func (b *Blockchain) ResetBatchTotals()

func (*Blockchain) SetAverageOrdersPerBatch

func (b *Blockchain) SetAverageOrdersPerBatch(i uint64)

SetAverageOrdersPerBatch sets new average orders per batch.

func (*Blockchain) SetAverageTxPerBatch

func (b *Blockchain) SetAverageTxPerBatch(i uint64)

func (*Blockchain) SetAverageTxSizeBytes

func (b *Blockchain) SetAverageTxSizeBytes(i uint64)

func (*Blockchain) SetBlockDuration

func (b *Blockchain) SetBlockDuration(val uint64)

func (*Blockchain) SetEventsPerSecond added in v0.68.0

func (b *Blockchain) SetEventsPerSecond(val uint64)

func (*Blockchain) SetHash

func (b *Blockchain) SetHash(hash string)

func (*Blockchain) SetHeight

func (b *Blockchain) SetHeight(height uint64)

func (*Blockchain) SetOrdersPerSecond

func (b *Blockchain) SetOrdersPerSecond(val uint64)

func (*Blockchain) SetTotalOrdersLastBatch

func (b *Blockchain) SetTotalOrdersLastBatch(i uint64)

SetTotalOrdersLastBatch assing total orders.

func (*Blockchain) SetTotalTradesLastBatch

func (b *Blockchain) SetTotalTradesLastBatch(i uint64)

SetTotalTradesLastBatch set total trades.

func (*Blockchain) SetTotalTxCurrentBatch

func (b *Blockchain) SetTotalTxCurrentBatch(i uint64)

func (*Blockchain) SetTotalTxLastBatch

func (b *Blockchain) SetTotalTxLastBatch(i uint64)

func (*Blockchain) SetTradesPerSecond

func (b *Blockchain) SetTradesPerSecond(val uint64)

func (Blockchain) TotalAmendOrder

func (b Blockchain) TotalAmendOrder() uint64

TotalAmendOrder returns the total amount of order amended processed by the vega node.

func (Blockchain) TotalBatches

func (b Blockchain) TotalBatches() uint64

TotalBatches get total batches.

func (Blockchain) TotalCancelOrder

func (b Blockchain) TotalCancelOrder() uint64

TotalCancelOrder return the total number of orders cancel by the vega node.

func (Blockchain) TotalCreateOrder

func (b Blockchain) TotalCreateOrder() uint64

TotalCreateOrder return the total amount of request to create a new order.

func (*Blockchain) TotalEventsLastBatch added in v0.68.0

func (b *Blockchain) TotalEventsLastBatch() uint64

func (Blockchain) TotalOrders

func (b Blockchain) TotalOrders() uint64

TotalOrders return the total amount of orders placed in the system.

func (Blockchain) TotalOrdersLastBatch

func (b Blockchain) TotalOrdersLastBatch() uint64

TotalOrdersLastBatch returns the number of orders accepted in the last block in the chain.

func (Blockchain) TotalTrades

func (b Blockchain) TotalTrades() uint64

TotalTrades return the total amount of trades in the system.

func (Blockchain) TotalTradesLastBatch

func (b Blockchain) TotalTradesLastBatch() uint64

TotalTradesLastBatch returns the number of trades created during the last block in the chain.

func (*Blockchain) TotalTxCurrentBatch

func (b *Blockchain) TotalTxCurrentBatch() uint64

func (*Blockchain) TotalTxLastBatch

func (b *Blockchain) TotalTxLastBatch() uint64

TotalTxLastBatch return the number of transaction processed in the last accepted block in the chain.

func (Blockchain) TradesPerSecond

func (b Blockchain) TradesPerSecond() uint64

TradesPerSecond return the total number of trades generated during the last second.

type Config

type Config struct {
	Level encoding.LogLevel `long:"log-level"`
}

Config represent the configuration.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.

type Stats

type Stats struct {
	Blockchain *Blockchain
	// contains filtered or unexported fields
}

Stats ties together all other package level application stats types.

func New

func New(log *logging.Logger, cfg Config) *Stats

New instantiates a new Stats.

func (*Stats) BlockHash

func (s *Stats) BlockHash() string

func (*Stats) GetChainVersion

func (s *Stats) GetChainVersion() string

GetChainVersion returns the version of the chain in use by vega.

func (*Stats) GetEpochExpireTime added in v0.59.0

func (s *Stats) GetEpochExpireTime() time.Time

func (*Stats) GetEpochSeq added in v0.59.0

func (s *Stats) GetEpochSeq() uint64

func (*Stats) GetEpochStartTime added in v0.59.0

func (s *Stats) GetEpochStartTime() time.Time

func (*Stats) GetUptime

func (s *Stats) GetUptime() time.Time

func (*Stats) GetVersion

func (s *Stats) GetVersion() string

GetVersion return the version of vega which is currently running.

func (*Stats) GetVersionHash

func (s *Stats) GetVersionHash() string

GetVersionHash return the hash of the commit this vega binary was compiled from.

func (*Stats) Height

func (s *Stats) Height() uint64

func (*Stats) OnEpochEvent added in v0.59.0

func (s *Stats) OnEpochEvent(_ context.Context, epoch types.Epoch)

func (*Stats) OnEpochRestore added in v0.59.0

func (s *Stats) OnEpochRestore(_ context.Context, epoch types.Epoch)

func (*Stats) ReloadConf

func (s *Stats) ReloadConf(cfg Config)

ReloadConf updates the internal configuration.

Jump to

Keyboard shortcuts

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