performance

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CacheFlagName            = "cache-be"
	CacheLatestBlockFlagName = "cache-latest-block"
)
View Source
const (
	// PyroscopeAddressFlagName is the flag name for the Pyroscope server address
	PyroscopeAddressFlagName = "pyroscope-address"
	// PyroscopeAppNameFlagName is the flag name for the Pyroscope application name
	PyroscopeAppNameFlagName = "pyroscope-app-name"
	// PyroscopeMutexProfileFractionFlagName is the flag name for the mutex profile sampling rate
	PyroscopeMutexProfileFractionFlagName = "pyroscope-mutex-profile-fraction"
	// PyroscopeBlockProfileRateFlagName is the flag name for the block profile rate
	PyroscopeBlockProfileRateFlagName = "pyroscope-block-profile-rate"
	// PyroscopeTagsFlagName is the flag name for custom tags to add to profiles
	PyroscopeTagsFlagName = "pyroscope-tags"

	// DefaultMutexProfileFraction is the default sampling rate for mutex profiling (1 in N events)
	DefaultMutexProfileFraction = 5
	// DefaultBlockProfileRate is the default rate for block profiling in nanoseconds
	DefaultBlockProfileRate = 1
)
View Source
const (
	PprofAddressFlagName = "pprof-address"
)

Variables

View Source
var (
	NotConnectedError   = errors.New("No Connection To grpc server")
	NotInitializedError = errors.New("to use cache run initCache")
)

Functions

func ParseTags

func ParseTags(tagsStr string) map[string]string

ParseTags parses a comma-separated list of key=value pairs into a map. Example input: "instance=provider-1,region=us-east,chain=ETH1"

func StartPprofServer

func StartPprofServer(addr string) error

func StartPyroscope

func StartPyroscope(appName, serverAddress string, mutexProfileFraction, blockProfileRate int, tags map[string]string) error

StartPyroscope initializes continuous profiling with Pyroscope It connects to a Pyroscope server and sends profiling data for: - CPU profiling - Memory allocation (objects and bytes) - Memory in-use (objects and bytes) - Goroutine profiling

Types

type Cache

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

func InitCache

func InitCache(ctx context.Context, addr string) (*Cache, error)

func (*Cache) CacheActive

func (cache *Cache) CacheActive() bool

func (*Cache) Flush

func (cache *Cache) Flush(ctx context.Context) error

Flush asks the cache-be server to drop every entry it holds. Reached only from the router's /debug/reset-all handler — never from the relay hot path. Returns NotInitializedError when --cache-be is not configured and NotConnectedError while the gRPC client is reconnecting; callers can treat both as "no external cache to flush" and proceed.

func (*Cache) GetEntry

func (cache *Cache) GetEntry(ctx context.Context, relayCacheGet *pairingtypes.RelayCacheGet) (reply *pairingtypes.CacheRelayReply, err error)

func (*Cache) SetEntry

func (cache *Cache) SetEntry(ctx context.Context, cacheSet *pairingtypes.RelayCacheSet) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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