metrics

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateTotals

func CalculateTotals(block *Block)

nolint CalculateTotals will calculate totals for a block.

func HandlerMetrics

func HandlerMetrics(w http.ResponseWriter, r *http.Request)

HandlerMetrics is a HTTP response handler for /metrics.

func Routine

func Routine()

Routine its a infinite loop that collects metrics.

func RunMetrics

func RunMetrics(gqlPort, nodePort, nodeAPIPort, port int, hostname string)

RunMetrics will run the metrics collection endpoint.

Types

type Block

type Block struct {
	Header Header        `json:"header"`
	Txs    []Transaction `json:"transactions"`
}

Block defines a block on the Dusk blockchain.

type Blocks

type Blocks struct {
	Blocks []Block `json:"blocks"`
}

Blocks is the placeholder for blocks.

type Client

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

Client is a wrapper for a gRPC client. It establishes connection with the server on startup, and then handles requests from other components over the RPCBus.

func InitRPCClients

func InitRPCClients(ctx context.Context, address string) *Client

InitRPCClients opens the connection with the Rusk gRPC server, and initializes the different clients which can speak to the Rusk server.

As the Rusk server is a fundamental part of the node functionality, this function will panic if the connection can not be established successfully.

func (*Client) Close

func (c *Client) Close() error

Close the connection to the gRPC server.

type DuskInfo

type DuskInfo struct {
	ContractsCreated   int64
	TokenTransfers     int64
	ContractCalls      int64
	DuskTransfers      int64
	BlockSize          float64
	LoadTime           float64
	TotalDusk          *big.Int
	EffectiveBlockTime int64
	GQLEndpoint        string
	GQLClient          *graphql.Client
	NodeAPIPort        int
}

DuskInfo is the placeholder for exporter metrics.

type Header struct {
	Version   uint8  `json:"version"`   // Block version byte
	Height    uint64 `json:"height"`    // Block height
	Timestamp string `json:"timestamp"` // Block timestamp
	GasLimit  uint64 `json:"gaslimit"`  // Block gas limit

	PrevBlockHash      []byte `json:"prev-hash"` // Hash of previous block (32 bytes)
	Seed               []byte `json:"seed"`      // Marshaled BLS signature or hash of the previous block seed (32 bytes)
	GeneratorBlsPubkey []byte `json:"generator"` // Generator BLS Public Key (96 bytes)

	//*Certificate `json:"certificate"` // Block certificate
	Hash []byte `json:"hash"` // Hash of all previous fields
}

Header defines a block header on a Dusk block.

type Transaction

type Transaction struct {
	// Inputs  []byte `json:"inputs,omitempty"`
	// Outputs []byte `json:"outputs"`
	// Fee     *byte  `json:"fee,omitempty"`
	// Proof   []byte `json:"proof,omitempty"`
	Data []byte `json:"data,omitempty"`
}

Transaction according to the Phoenix model.

Jump to

Keyboard shortcuts

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