statistics

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	BlockStart struct {
		sync.RWMutex
		// contains filtered or unexported fields
	}
	BlockEnd blockEnd

	Speed struct {
		sync.RWMutex
		// contains filtered or unexported fields
	}

	Api  apiResponseTime
	Peer peerPing
	// contains filtered or unexported fields
}

func New

func New() *Data

func (*Data) GetAverageBlockProcessingTime added in v1.1.6

func (d *Data) GetAverageBlockProcessingTime() int64

func (*Data) GetLastBlockInfo added in v1.1.6

func (d *Data) GetLastBlockInfo() LastBlockInfo

func (*Data) GetTimePerBlock added in v1.1.6

func (d *Data) GetTimePerBlock() int64

func (*Data) PushEndBlock added in v1.1.6

func (d *Data) PushEndBlock(req *EndRequest)

func (*Data) PushStartBlock added in v1.1.6

func (d *Data) PushStartBlock(req *StartRequest)

func (*Data) ResetPeersPing added in v1.1.6

func (d *Data) ResetPeersPing()

func (*Data) SetApiTime

func (d *Data) SetApiTime(duration time.Duration, path string)

func (*Data) SetPeerTime

func (d *Data) SetPeerTime(duration time.Duration, network string)

func (*Data) Statistic

func (d *Data) Statistic(ctx context.Context)

type EndRequest added in v1.1.6

type EndRequest struct {
	TimeEnd time.Time
	Height  int64
}

type LastBlockInfo added in v1.1.6

type LastBlockInfo struct {
	Height          int64
	Duration        int64
	HeaderTimestamp time.Time
}

type StartRequest added in v1.1.6

type StartRequest struct {
	Height     int64
	Now        time.Time
	HeaderTime time.Time
}

Jump to

Keyboard shortcuts

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