telemetry

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimoutMessageSending = errors.New("timeout sending telemetry message")

Functions

This section is empty.

Types

type AfgApplyingForcedAuthoritySetChange added in v0.8.0

type AfgApplyingForcedAuthoritySetChange struct {
	Block string `json:"block"`
}

AfgApplyingForcedAuthoritySetChange is a telemetry message of type `afg.applying_forced_authority_set_change` which is meant to be sent when a forced change is applied

func NewAfgApplyingForcedAuthoritySetChange added in v0.8.0

func NewAfgApplyingForcedAuthoritySetChange(block string) *AfgApplyingForcedAuthoritySetChange

NewAfgApplyingForcedAuthoritySetChange creates a new AfgAuthoritySetTM struct.

func (AfgApplyingForcedAuthoritySetChange) MarshalJSON added in v0.8.0

func (afg AfgApplyingForcedAuthoritySetChange) MarshalJSON() ([]byte, error)

type AfgApplyingScheduledAuthoritySetChange added in v0.8.0

type AfgApplyingScheduledAuthoritySetChange struct {
	Block string `json:"block"`
}

AfgApplyingScheduledAuthoritySetChange is a telemetry message of type `afg.applying_scheduled_authority_set_change` which is meant to be sent when a scheduled change is applied

func NewAfgApplyingScheduledAuthoritySetChange added in v0.8.0

func NewAfgApplyingScheduledAuthoritySetChange(block string) *AfgApplyingScheduledAuthoritySetChange

NewAfgApplyingScheduledAuthoritySetChange creates a new AfgAuthoritySetTM struct.

func (AfgApplyingScheduledAuthoritySetChange) MarshalJSON added in v0.8.0

func (afg AfgApplyingScheduledAuthoritySetChange) MarshalJSON() ([]byte, error)

type AfgAuthoritySet added in v0.7.0

type AfgAuthoritySet struct {
	AuthorityID    string `json:"authority_id"`
	AuthoritySetID string `json:"authority_set_id"`
	// Substrate creates an array of string of authority IDs. It JSON-serialises
	// that array and send that as a string.
	Authorities string `json:"authorities"`
}

AfgAuthoritySet is a telemetry message of type `afg.authority_set` which is meant to be sent when authority set changes (generally when a round is initiated)

func NewAfgAuthoritySet added in v0.7.0

func NewAfgAuthoritySet(authorityID, authoritySetID, authorities string) *AfgAuthoritySet

NewAfgAuthoritySet creates a new AfgAuthoritySetTM struct.

func (AfgAuthoritySet) MarshalJSON added in v0.7.0

func (afg AfgAuthoritySet) MarshalJSON() ([]byte, error)

type AfgFinalizedBlocksUpTo added in v0.7.0

type AfgFinalizedBlocksUpTo struct {
	Hash   common.Hash `json:"hash"`
	Number string      `json:"number"`
}

AfgFinalizedBlocksUpTo holds telemetry message of type `afg.finalized_blocks_up_to`, which is supposed to be sent when GRANDPA client finalises new blocks.

func NewAfgFinalizedBlocksUpTo added in v0.7.0

func NewAfgFinalizedBlocksUpTo(hash common.Hash, number string) *AfgFinalizedBlocksUpTo

NewAfgFinalizedBlocksUpTo creates a new AfgFinalizedBlocksUpToTM struct.

func (AfgFinalizedBlocksUpTo) MarshalJSON added in v0.7.0

func (afg AfgFinalizedBlocksUpTo) MarshalJSON() ([]byte, error)

type AfgReceivedCommit added in v0.7.0

type AfgReceivedCommit struct {
	TargetHash                 common.Hash `json:"target_hash"`
	TargetNumber               string      `json:"target_number"`
	ContainsPrecommitsSignedBy []string    `json:"contains_precommits_signed_by"`
}

AfgReceivedCommit holds `afg.received_commit` telemetry message which is supposed to be sent when grandpa client receives a commit.

func NewAfgReceivedCommit added in v0.7.0

func NewAfgReceivedCommit(targetHash common.Hash, targetNumber string,
	containsPrecommitsSignedBy []string) *AfgReceivedCommit

NewAfgReceivedCommit gets a new AfgReceivedCommit* struct.

func (AfgReceivedCommit) MarshalJSON added in v0.7.0

func (afg AfgReceivedCommit) MarshalJSON() ([]byte, error)

type AfgReceivedPrecommit added in v0.7.0

type AfgReceivedPrecommit afgReceived

AfgReceivedPrecommit holds `afg.received_precommit` telemetry message which is supposed to be sent when grandpa client receives a precommit.

func NewAfgReceivedPrecommit added in v0.7.0

func NewAfgReceivedPrecommit(targetHash common.Hash, targetNumber, voter string) *AfgReceivedPrecommit

NewAfgReceivedPrecommit gets a new AfgReceivedPrecommitTM struct.

func (AfgReceivedPrecommit) MarshalJSON added in v0.7.0

func (afg AfgReceivedPrecommit) MarshalJSON() ([]byte, error)

type AfgReceivedPrevote added in v0.7.0

type AfgReceivedPrevote afgReceived

AfgReceivedPrevote holds `afg.received_prevote` telemetry message which is supposed to be sent when grandpa client receives a prevote.

func NewAfgReceivedPrevote added in v0.7.0

func NewAfgReceivedPrevote(targetHash common.Hash, targetNumber, voter string) *AfgReceivedPrevote

NewAfgReceivedPrevote gets a new AfgReceivedPrevote* struct.

func (AfgReceivedPrevote) MarshalJSON added in v0.7.0

func (afg AfgReceivedPrevote) MarshalJSON() ([]byte, error)

type BlockImport added in v0.7.0

type BlockImport struct {
	BestHash *common.Hash `json:"best"`
	Height   uint         `json:"height"`
	Origin   string       `json:"origin"`
}

BlockImport struct to hold block import telemetry messages

func NewBlockImport added in v0.7.0

func NewBlockImport(bestHash *common.Hash, height uint, origin string) *BlockImport

NewBlockImport function to create new Block Import Telemetry Message

func (BlockImport) MarshalJSON added in v0.7.0

func (bi BlockImport) MarshalJSON() ([]byte, error)

type Client added in v0.7.0

type Client interface {
	SendMessage(msg json.Marshaler)
}

Client is the interface to send messages to telemetry servers

type Logger added in v0.8.0

type Logger interface {
	Debugf(format string, args ...interface{})
	Warnf(format string, args ...interface{})
}

Logger for the telemetry client.

type Mailer added in v0.7.0

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

Mailer can send messages to the telemetry servers.

func BootstrapMailer added in v0.7.0

func BootstrapMailer(ctx context.Context, conns []*genesis.TelemetryEndpoint, logger Logger) (
	mailer *Mailer, err error)

BootstrapMailer setup the mailer, the connections and start the async message shipment

func (*Mailer) SendMessage added in v0.7.0

func (m *Mailer) SendMessage(msg json.Marshaler)

SendMessage sends Message to connected telemetry listeners through messageReceiver

type Noop added in v0.7.0

type Noop struct{}

Noop is a no-op telemetry client implementation.

func NewNoopMailer added in v0.7.0

func NewNoopMailer() *Noop

NewNoopMailer returns a no-op telemetry mailer implementation.

func (*Noop) SendMessage added in v0.7.0

func (*Noop) SendMessage(_ json.Marshaler)

SendMessage does nothing.

type NoopClient added in v0.7.0

type NoopClient struct{}

NoopClient used for minimal implementation of the Client interface

func (NoopClient) SendMessage added in v0.7.0

func (NoopClient) SendMessage(_ json.Marshaler)

SendMessage is an empty implementation used for testing

type NotifyFinalized added in v0.7.0

type NotifyFinalized struct {
	Best common.Hash `json:"best"`
	// Height is same as block.Header.Number
	Height string `json:"height"`
}

NotifyFinalized holds `notify.finalized` telemetry message, which is supposed to be send when a new block gets finalised.

func NewNotifyFinalized added in v0.7.0

func NewNotifyFinalized(best common.Hash, height string) *NotifyFinalized

NewNotifyFinalized gets a new NotifyFinalizedTM struct.

func (NotifyFinalized) MarshalJSON added in v0.7.0

func (nf NotifyFinalized) MarshalJSON() ([]byte, error)

type PreparedBlockForProposing added in v0.7.0

type PreparedBlockForProposing struct {
	Hash common.Hash `json:"hash"`
	// Height of the chain, Block.Header.Number
	Number string `json:"number"`
}

PreparedBlockForProposing holds a 'prepared_block_for_proposing' telemetry message, which is supposed to be sent when a new block is built.

func NewPreparedBlockForProposing added in v0.7.0

func NewPreparedBlockForProposing(hash common.Hash, number string) *PreparedBlockForProposing

NewPreparedBlockForProposing gets a new PreparedBlockForProposingTM struct.

func (PreparedBlockForProposing) MarshalJSON added in v0.7.0

func (pb PreparedBlockForProposing) MarshalJSON() ([]byte, error)

type SystemConnected added in v0.7.0

type SystemConnected struct {
	Authority      bool         `json:"authority"`
	Chain          string       `json:"chain"`
	GenesisHash    *common.Hash `json:"genesis_hash"`
	Implementation string       `json:"implementation"`
	Name           string       `json:"name"`
	NetworkID      string       `json:"network_id"`
	StartupTime    string       `json:"startup_time"`
	Version        string       `json:"version"`
}

SystemConnected struct to hold system connected telemetry messages

func NewSystemConnected added in v0.7.0

func NewSystemConnected(authority bool, chain string, genesisHash *common.Hash,
	implementation, name, networkID, startupTime, version string) *SystemConnected

NewSystemConnected function to create new System Connected Telemetry Message

func (SystemConnected) MarshalJSON added in v0.7.0

func (sc SystemConnected) MarshalJSON() ([]byte, error)

type SystemInterval added in v0.7.0

type SystemInterval struct {
	BandwidthDownload  float64      `json:"bandwidth_download,omitempty"`
	BandwidthUpload    float64      `json:"bandwidth_upload,omitempty"`
	Peers              int          `json:"peers,omitempty"`
	BestHash           *common.Hash `json:"best,omitempty"`
	BestHeight         uint         `json:"height,omitempty"`
	FinalisedHash      *common.Hash `json:"finalized_hash,omitempty"`
	FinalisedHeight    uint         `json:"finalized_height,omitempty"`
	TxCount            *big.Int     `json:"txcount,omitempty"`
	UsedStateCacheSize *big.Int     `json:"used_state_cache_size,omitempty"`
}

SystemInterval struct to hold system interval telemetry messages

func NewBandwidth added in v0.7.0

func NewBandwidth(bandwidthDownload, bandwidthUpload float64, peers int) *SystemInterval

NewBandwidth function to create new Bandwidth Telemetry Message

func NewBlockInterval added in v0.7.0

func NewBlockInterval(beshHash *common.Hash, bestHeight uint, finalisedHash *common.Hash,
	finalisedHeight uint, txCount, usedStateCacheSize *big.Int) *SystemInterval

NewBlockInterval function to create new Block Interval Telemetry Message

func (SystemInterval) MarshalJSON added in v0.7.0

func (si SystemInterval) MarshalJSON() ([]byte, error)

type TxpoolImport added in v0.7.0

type TxpoolImport struct {
	Ready  uint `json:"ready"`
	Future uint `json:"future"`
}

TxpoolImport holds `txpool.import` telemetry message, which is supposed to be sent when a new transaction gets imported in the transaction pool.

func NewTxpoolImport added in v0.7.0

func NewTxpoolImport(ready, future uint) *TxpoolImport

NewTxpoolImport creates a new TxpoolImportTM struct

func (TxpoolImport) MarshalJSON added in v0.7.0

func (tx TxpoolImport) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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