quaistats

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Package quaistats implements the network stats reporting service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(node *node.Node, backend backend, engine consensus.Engine, url string, sendfullstats bool) error

New returns a monitoring service ready for stats reporting.

Types

type AuthResponse

type AuthResponse struct {
	Success bool   `json:"success"`
	Token   string `json:"token"`
}

type BatchObject added in v0.25.0

type BatchObject struct {
	TotalNoTransactions uint64
	OldestBlockTime     uint64
}

type Credentials

type Credentials struct {
	Name     string `json:"name"`
	Password string `json:"password"`
}

type Service

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

Service implements an Quai netstats reporting daemon that pushes local chain statistics up to a monitoring server.

func (*Service) Start

func (s *Service) Start() error

Start implements node.Lifecycle, starting up the monitoring and reporting daemon.

func (*Service) Stop

func (s *Service) Stop() error

Stop implements node.Lifecycle, terminating the monitoring and reporting daemon.

type StatsQueue added in v0.25.0

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

StatsQueue is a thread-safe queue designed for managing and processing stats data.

The primary objective of the StatsQueue is to provide a safe mechanism for enqueuing, dequeuing, and requeuing stats objects concurrently across multiple goroutines.

Key Features:

  • Enqueue: Allows adding an item to the end of the queue.
  • Dequeue: Removes and returns the item from the front of the queue.
  • RequeueFront: Adds an item back to the front of the queue, useful for failed processing attempts.

Concurrent Access:

  • The internal state of the queue is protected by a mutex to prevent data races and ensure that the operations are atomic. As a result, it's safe to use across multiple goroutines without external synchronization.

func NewStatsQueue added in v0.25.0

func NewStatsQueue() *StatsQueue

func (*StatsQueue) Dequeue added in v0.25.0

func (q *StatsQueue) Dequeue() interface{}

func (*StatsQueue) Enqueue added in v0.25.0

func (q *StatsQueue) Enqueue(item interface{})

func (*StatsQueue) EnqueueFront added in v0.25.0

func (q *StatsQueue) EnqueueFront(item interface{})

func (*StatsQueue) EnqueueFrontBatch added in v0.27.0

func (q *StatsQueue) EnqueueFrontBatch(items []interface{})

func (*StatsQueue) Size added in v0.25.0

func (q *StatsQueue) Size() int

Jump to

Keyboard shortcuts

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