metrics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NopCollector = &nopCollector{}

Functions

This section is empty.

Types

type Collector

type Collector interface {
	ApiErrorOccurred()
	TraceDownloadFailed()
	ServerPanicked(reason string)
	CadenceHeightIndexed(height uint64)
	EVMHeightIndexed(height uint64)
	EVMTransactionIndexed(count int)
	EVMAccountInteraction(address string)
	MeasureRequestDuration(start time.Time, method string)
	OperatorBalance(account *flow.Account)
	AvailableSigningKeys(count int)
}

func NewCollector

func NewCollector(logger zerolog.Logger) Collector

type DefaultCollector

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

func (*DefaultCollector) ApiErrorOccurred

func (c *DefaultCollector) ApiErrorOccurred()

func (*DefaultCollector) AvailableSigningKeys added in v1.0.0

func (c *DefaultCollector) AvailableSigningKeys(count int)

func (*DefaultCollector) CadenceHeightIndexed added in v0.36.4

func (c *DefaultCollector) CadenceHeightIndexed(height uint64)

func (*DefaultCollector) EVMAccountInteraction added in v0.27.0

func (c *DefaultCollector) EVMAccountInteraction(address string)

func (*DefaultCollector) EVMHeightIndexed added in v0.27.0

func (c *DefaultCollector) EVMHeightIndexed(height uint64)

func (*DefaultCollector) EVMTransactionIndexed added in v0.36.5

func (c *DefaultCollector) EVMTransactionIndexed(count int)

func (*DefaultCollector) MeasureRequestDuration

func (c *DefaultCollector) MeasureRequestDuration(start time.Time, method string)

func (*DefaultCollector) OperatorBalance added in v0.31.0

func (c *DefaultCollector) OperatorBalance(account *flow.Account)

func (*DefaultCollector) ServerPanicked

func (c *DefaultCollector) ServerPanicked(reason string)

func (*DefaultCollector) TraceDownloadFailed added in v0.27.0

func (c *DefaultCollector) TraceDownloadFailed()

type HttpHandler

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

HttpHandler is a thin middleware for gathering metrics about http request. It makes no decision about error handling. If one occurred, we log it and pass request on to the underlying handler to make a decision

func NewMetricsHandler added in v0.27.0

func NewMetricsHandler(handler http.Handler, collector Collector, log zerolog.Logger) *HttpHandler

func (*HttpHandler) ServeHTTP

func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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