metrics

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SeataTransaction = "seata.transaction"

	NameKey = "name"

	RoleKey = "role"

	MeterKey = "meter"

	StatisticKey = "statistic"

	StatusKey = "status"

	RoleValueTc = "tc"

	RoleValueTm = "client"

	RoleValueRm = "rm"

	MeterValueGauge = "gauge"

	MeterValueCounter = "counter"

	MeterValueSummary = "summary"

	MeterValueTimer = "timer"

	StatisticValueCount = "count"

	StatisticValueTotal = "total"

	StatisticValueTps = "tps"

	StatisticValueMax = "max"

	StatisticValueAverage = "average"

	StatusValueActive = "active"

	StatusValueCommitted = "committed"

	StatusValueRollbacked = "rollbacked"
)
View Source
var (
	CounterActive = &Counter{
		Counter: metrics.NewCounter(),
		Name:    SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueCounter,
			StatusKey: StatusValueActive,
		},
	}
	CounterCommitted = &Counter{
		Counter: metrics.NewCounter(),
		Name:    SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueCounter,
			StatusKey: StatusValueCommitted,
		},
	}
	CounterRollbacked = &Counter{
		Counter: metrics.NewCounter(),
		Name:    SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueCounter,
			StatusKey: StatusValueRollbacked,
		},
	}
	SummaryCommitted = &Summary{
		Meter: metrics.NewMeter(),
		Name:  SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueSummary,
			StatusKey: StatusValueCommitted,
		},
	}
	SummaryRollbacked = &Summary{
		Meter: metrics.NewMeter(),
		Name:  SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueSummary,
			StatusKey: StatusValueRollbacked,
		},
	}
	TimerCommitted = &Histogram{
		Histogram: metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015)),
		Name:      SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueTimer,
			StatusKey: StatusValueCommitted,
		},
	}
	TimerRollback = &Histogram{
		Histogram: metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015)),
		Name:      SeataTransaction,
		Labels: map[string]string{
			RoleKey:   RoleValueTc,
			MeterKey:  MeterValueTimer,
			StatusKey: StatusValueRollbacked,
		},
	}
)

Functions

This section is empty.

Types

type Counter

type Counter struct {
	metrics.Counter
	Name   string
	Labels map[string]string
	// contains filtered or unexported fields
}

func (*Counter) SortedLabels

func (c *Counter) SortedLabels() (keys, vals []string)

type Histogram

type Histogram struct {
	metrics.Histogram
	Name   string
	Labels map[string]string
	// contains filtered or unexported fields
}

func (*Histogram) SortedLabels

func (h *Histogram) SortedLabels() (keys, vals []string)

type Subscriber

type Subscriber struct {
}

func (*Subscriber) ProcessGlobalTransactionEvent

func (subscriber *Subscriber) ProcessGlobalTransactionEvent()

type Summary

type Summary struct {
	metrics.Meter
	Name   string
	Labels map[string]string
	// contains filtered or unexported fields
}

func (*Summary) SortedLabels

func (s *Summary) SortedLabels() (keys, vals []string)

Jump to

Keyboard shortcuts

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