collector

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCollector

func NewCollector(db Db, url string) *eventsCollector

NewCollector created a new instance of the collector listening on url for events and writing them to the provided Db

Types

type Db

type Db interface {
	StoreBlock(event *events.NewBlock) error
	StoreBlockValid(event *events.ValidBlock) error
	StoreTx(event *events.NewTx) error
	StoreTxValid(event *events.ValidTx) error
	StoreAtx(event *events.NewAtx) error
	StoreAtxValid(event *events.ValidAtx) error
	StoreReward(event *events.RewardReceived) error
	StoreBlockCreated(event *events.DoneCreatingBlock) error
	StoreAtxCreated(event *events.AtxCreated) error
}

type Event

type Event interface {
	GetChannel() events.ChannelId
}

type MemoryCollector

type MemoryCollector struct {
	Atxs map[string]uint64
	// contains filtered or unexported fields
}

func NewMemoryCollector

func NewMemoryCollector() *MemoryCollector

func (*MemoryCollector) GetAtxCreationDone

func (c *MemoryCollector) GetAtxCreationDone(layer types.EpochId) int

func (*MemoryCollector) GetBlockCreationDone

func (c *MemoryCollector) GetBlockCreationDone(layer types.LayerID) int

func (*MemoryCollector) GetCreatedAtx

func (c *MemoryCollector) GetCreatedAtx(epoch types.EpochId) []string

func (*MemoryCollector) GetNumOfCreatedATXs

func (c *MemoryCollector) GetNumOfCreatedATXs(layer types.LayerID) int

func (*MemoryCollector) GetNumOfCreatedBlocks

func (c *MemoryCollector) GetNumOfCreatedBlocks(layer types.LayerID) int

func (*MemoryCollector) GetReceivedATXsNum

func (c *MemoryCollector) GetReceivedATXsNum(layer types.LayerID) int

func (*MemoryCollector) GetReceivedBlocks

func (c *MemoryCollector) GetReceivedBlocks(layer types.LayerID) int

func (*MemoryCollector) StoreAtx

func (c *MemoryCollector) StoreAtx(event *events.NewAtx) error

func (*MemoryCollector) StoreAtxCreated

func (c *MemoryCollector) StoreAtxCreated(event *events.AtxCreated) error

func (*MemoryCollector) StoreAtxValid

func (c *MemoryCollector) StoreAtxValid(event *events.ValidAtx) error

func (*MemoryCollector) StoreBlock

func (c *MemoryCollector) StoreBlock(event *events.NewBlock) error

func (*MemoryCollector) StoreBlockCreated

func (c *MemoryCollector) StoreBlockCreated(event *events.DoneCreatingBlock) error

func (*MemoryCollector) StoreBlockValid

func (c *MemoryCollector) StoreBlockValid(event *events.ValidBlock) error

func (*MemoryCollector) StoreReward

func (c *MemoryCollector) StoreReward(event *events.RewardReceived) error

func (*MemoryCollector) StoreTx

func (c *MemoryCollector) StoreTx(event *events.NewTx) error

func (*MemoryCollector) StoreTxValid

func (c *MemoryCollector) StoreTxValid(event *events.ValidTx) error

Jump to

Keyboard shortcuts

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