metrics

package
v0.0.0-...-6a474e3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSubsystemName

func MakeSubsystemName(serviceName string, subServiceName string) string

MakeSubsystemName builds the subsystem name for a group of metrics, which prometheus will use to prefix all metrics in the group. If two non-empty strings are provided, they are joined with an underscore. If only one non-empty string is provided, that name will be used alone. Otherwise an empty string is returned after converting the characters to lower case.

NOTE: This method panics if spaces are included in either string.

func RunServer

func RunServer(hostname string, port uint64)

RunServer spins up a prometheus metrics server at the provided hostname and port.

NOTE: This method MUST be run as a goroutine.

Types

type Base

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

func NewBase

func NewBase(serviceName, subServiceName string) *Base

func (*Base) BalanceETH

func (b *Base) BalanceETH() prometheus.Gauge

BalanceETH tracks the amount of ETH in the submitter's account.

func (*Base) BatchConfirmationTimeMs

func (b *Base) BatchConfirmationTimeMs() prometheus.Gauge

BatchConfirmationTimeMs tracks the duration it takes to confirm a batch transaction.

func (*Base) BatchSizeBytes

func (b *Base) BatchSizeBytes() prometheus.Summary

BatchSizeBytes tracks the size of batch submission transactions.

func (*Base) BatchTxBuildTimeMs

func (b *Base) BatchTxBuildTimeMs() prometheus.Gauge

BatchTxBuildTimeMs tracks the duration it takes to construct a batch transaction.

func (*Base) BatchesSubmitted

func (b *Base) BatchesSubmitted() prometheus.Counter

BatchsSubmitted tracks the total number of successful batch submissions.

func (*Base) FailedSubmissions

func (b *Base) FailedSubmissions() prometheus.Counter

FailedSubmissions tracks the total number of failed batch submissions.

func (*Base) NumElementsPerBatch

func (b *Base) NumElementsPerBatch() prometheus.Summary

NumElementsPerBatch tracks the number of L2 transactions in each batch submission.

func (*Base) SubmissionGasUsedWei

func (b *Base) SubmissionGasUsedWei() prometheus.Gauge

SubmissionGasUsedWei tracks the amount of gas used to submit each batch.

func (*Base) SubmissionTimestamp

func (b *Base) SubmissionTimestamp() prometheus.Gauge

SubmissionTimestamp tracks the time at which each batch was confirmed.

func (*Base) SubsystemName

func (b *Base) SubsystemName() string

SubsystemName returns the subsystem name for the metrics group.

type Metrics

type Metrics interface {
	// SubsystemName returns the subsystem name for the metrics group.
	SubsystemName() string

	// BalanceETH tracks the amount of ETH in the submitter's account.
	BalanceETH() prometheus.Gauge

	// BatchSizeBytes tracks the size of batch submission transactions.
	BatchSizeBytes() prometheus.Summary

	// NumElementsPerBatch tracks the number of L2 transactions in each batch
	// submission.
	NumElementsPerBatch() prometheus.Summary

	// SubmissionTimestamp tracks the time at which each batch was confirmed.
	SubmissionTimestamp() prometheus.Gauge

	// SubmissionGasUsedWei tracks the amount of gas used to submit each batch.
	SubmissionGasUsedWei() prometheus.Gauge

	// BatchsSubmitted tracks the total number of successful batch submissions.
	BatchesSubmitted() prometheus.Counter

	// FailedSubmissions tracks the total number of failed batch submissions.
	FailedSubmissions() prometheus.Counter

	// BatchTxBuildTimeMs tracks the duration it takes to construct a batch
	// transaction.
	BatchTxBuildTimeMs() prometheus.Gauge

	// BatchConfirmationTimeMs tracks the duration it takes to confirm a batch
	// transaction.
	BatchConfirmationTimeMs() prometheus.Gauge
}

Jump to

Keyboard shortcuts

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