rtmcollect

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRTMetrics

func NewRTMetrics() *memmetrics.RTMetrics

NewRTMetrics is a convenience wrapper around memmetrics.NewRTMetrics() to get rid of unnecessary error check that never actually happens.

Types

type BeSrvEntry

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

BeSrvEntry used to store a backend server storage config along with respective round-trip metrics in a map.

func (*BeSrvEntry) CfgWithStats

func (e *BeSrvEntry) CfgWithStats() engine.Server

CfgWithStats returns a backend server storage config along with round-trip stats.

type T

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

T watches and aggregates round-trip metrics for calls to its ServeHTTP function and all backend servers that handle it.

func New

func New(handler http.Handler) (*T, error)

New returns a new round-trip metrics collector instance.

func (*T) AppendAllBeSrvRTMsTo

func (c *T) AppendAllBeSrvRTMsTo(aggregates map[backend.SrvURLKey]BeSrvEntry)

AppendAllBeSrvRTMsTo appends round-trip metrics of all backend servers of the backend associated with the frontend to the respective aggregates. If an aggregate for a server is missing from the map then a new one is created.

func (*T) AppendBeSrvRTMTo

func (c *T) AppendBeSrvRTMTo(aggregate *memmetrics.RTMetrics, beSrvURLKey backend.SrvURLKey) error

AppendBeSrvRTMTo appends round-trip metrics of a backend server to aggregate. It does nothing if a server if the specified URL key does not exist.

func (*T) AppendFeRTMTo

func (c *T) AppendFeRTMTo(aggregate *memmetrics.RTMetrics) error

AppendFeRTMTo appends frontend round-trip metrics to an aggregate.

func (*T) RTStats

func (c *T) RTStats() (*engine.RoundTripStats, error)

RTStats returns round-trip stats of the associated frontend.

func (*T) RemoveServer

func (c *T) RemoveServer(beSrvURLKey backend.SrvURLKey)

RemoveServer removes a backend server from the list of servers that it collects round-trip metrics for.

func (*T) ServeHTTP

func (c *T) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler.

func (*T) UpsertServer

func (c *T) UpsertServer(beSrv backend.Srv)

UpsertServer upserts a backend server to collect round-trip metrics for.

Jump to

Keyboard shortcuts

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