rpcstats

package
v0.89.13 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountCall

func CountCall(method string)

Types

type PublicAPI

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

PublicAPI represents a set of APIs from the namespace.

func NewAPI

func NewAPI(s *Service) *PublicAPI

NewAPI creates an instance of the API.

func (*PublicAPI) GetStats

func (api *PublicAPI) GetStats(context context.Context) (RPCStats, error)

GetStats retrun RPC usage stats

func (*PublicAPI) Reset

func (api *PublicAPI) Reset(context context.Context)

Reset resets RPC usage stats

type RPCStats

type RPCStats struct {
	Total            uint            `json:"total"`
	CounterPerMethod map[string]uint `json:"methods"`
}

type RPCUsageStats

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

type Service

type Service struct{}

Service represents our own implementation of status status operations.

func New

func New() *Service

New returns a new Service.

func (*Service) APIs

func (s *Service) APIs() []rpc.API

APIs returns a list of new APIs.

func (*Service) Protocols

func (s *Service) Protocols() []p2p.Protocol

Protocols returns list of p2p protocols.

func (*Service) Start

func (s *Service) Start() error

Start is run when a service is started. It does nothing in this case but is required by `node.Service` interface.

func (*Service) Stop

func (s *Service) Stop() error

Stop is run when a service is stopped. It does nothing in this case but is required by `node.Service` interface.

Jump to

Keyboard shortcuts

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