metrics

package
v0.24.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodCountsName       = "serviceweaver_method_count"
	MethodErrorsName       = "serviceweaver_method_error_count"
	MethodLatenciesName    = "serviceweaver_method_latency_micros"
	MethodBytesRequestName = "serviceweaver_method_bytes_request"
	MethodBytesReplyName   = "serviceweaver_method_bytes_reply"
)

Names of automatically populated metrics.

Variables

View Source
var GeneratedBuckets = []float64{

	1, 2, 5,
	10, 20, 50,
	100, 200, 500,
	1000, 2000, 5000,
	10000, 20000, 50000,
	100000, 200000, 500000,
	1000000, 2000000, 5000000,
	10000000, 20000000, 50000000,
	100000000, 200000000, 500000000,
	1000000000, 2000000000, 5000000000,
}

GeneratedBuckets provides rounded bucket boundaries for histograms that will only store non-negative values.

Note that these buckets are intended to be used only by the metrics generated by the weaver runtime.

Functions

This section is empty.

Types

type AppStatuszInfo

type AppStatuszInfo struct {
	App        string
	Deployment string
	Age        string
	TraceFile  string
	Listeners  map[string][]string
	Config     map[string]string
	Components []ComponentStatuszInfo
}

AppStatuszInfo contains per app information to be displayed on the /statusz page.

type ComponentStatuszInfo

type ComponentStatuszInfo struct {
	Name        string              // Name of the component
	Replication int                 // Number of replicas
	Stats       []methodStatuszInfo // Per method status
}

ComponentStatuszInfo contains per component information to be displayed on the /statusz page.

type StatsProcessor

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

StatsProcessor keeps track of various statistics for a given app deployment.

func NewStatsProcessor

func NewStatsProcessor() *StatsProcessor

func (*StatsProcessor) CollectMetrics

func (s *StatsProcessor) CollectMetrics(ctx context.Context, snapshotFn func() []*metrics.MetricSnapshot) error

CollectMetrics enables the stats processor to update the tracked stats based on a new set of metrics provided by snapshotFn.

func (*StatsProcessor) GetStatsStatusz

func (s *StatsProcessor) GetStatsStatusz() map[string][]methodStatuszInfo

GetStatsStatusz returns the latest stats that should be rendered on the /statusz page.

Jump to

Keyboard shortcuts

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