metrics

package
v0.0.0-...-14f6295 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InsertQueue

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

func NewInsertQueue

func NewInsertQueue(metrics *Metrics) *InsertQueue

func (*InsertQueue) Add

func (i *InsertQueue) Add(data *models.CelestiaNode)

This function puts data in a queue and adds them to the DB whenever it can,

to be able to keep up with a big load of coming data

func (*InsertQueue) Start

func (i *InsertQueue) Start() error

func (*InsertQueue) Stop

func (i *InsertQueue) Stop()

type Metrics

type Metrics struct {
	InsertQueue *InsertQueue
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB) *Metrics

func (*Metrics) AddNodeData

func (m *Metrics) AddNodeData(data *models.CelestiaNode) error

func (*Metrics) FindByNodeId

func (m *Metrics) FindByNodeId(nodeId string, offset, limit int) ([]models.CelestiaNode, int64, error)

func (*Metrics) FindByNodeIdAtNetworkHeight

func (m *Metrics) FindByNodeIdAtNetworkHeight(nodeId string, networkHeight uint64) ([]models.CelestiaNode, error)

func (*Metrics) FindByNodeIdAtNetworkHeightRange

func (m *Metrics) FindByNodeIdAtNetworkHeightRange(nodeId string, networkHeightBegin, networkHeightEnd uint64) ([]models.CelestiaNode, error)

func (*Metrics) GetAllNodes

func (m *Metrics) GetAllNodes(offset, limit int) ([]models.CelestiaNode, int64, error)

func (*Metrics) GetLatestNodeData

func (m *Metrics) GetLatestNodeData(nodeId string) (models.CelestiaNode, error)

func (*Metrics) GetNodeDataByMetricTime

func (m *Metrics) GetNodeDataByMetricTime(nodeId string, metricTime time.Time) (models.CelestiaNode, error)

func (*Metrics) GetNodeUpTime

func (m *Metrics) GetNodeUpTime(nodeId string) (float32, error)

func (*Metrics) GetNodesByType

func (m *Metrics) GetNodesByType(nType receiver.NodeType, offset, limit int) ([]models.CelestiaNode, int64, error)

func (*Metrics) GetNodesVersions

func (m *Metrics) GetNodesVersions(nodeId string) ([]models.NodeVersion, error)

func (*Metrics) RecomputeUptimeForAll

func (m *Metrics) RecomputeUptimeForAll(uptimeStartTime, uptimeEndTime time.Time) ([]models.CelestiaNode, error)

Jump to

Keyboard shortcuts

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