metrics

package
v1.0.0-rc.8 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 13 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)
}

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) 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)

type Server

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

Server is the http server that will be serving metrics requests

func NewServer

func NewServer(log zerolog.Logger, port int) *Server

NewServer creates a new server that will start on the specified port, and responds to only the `/metrics` endpoint

func (*Server) Start added in v0.27.0

func (s *Server) Start() (<-chan struct{}, error)

Start starts the server and returns a channel which is closed when the server is ready to serve requests.

func (*Server) Stop added in v0.27.0

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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