metrics

package
v0.1.10-0...-9bf53c4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SEATA_TRANSACTION = "seata.transaction"

	NAME_KEY = "name"

	ROLE_KEY = "role"

	METER_KEY = "meter"

	STATISTIC_KEY = "statistic"

	STATUS_KEY = "status"

	ROLE_VALUE_TC = "tc"

	ROLE_VALUE_TM = "tm"

	ROLE_VALUE_RM = "rm"

	METER_VALUE_GAUGE = "gauge"

	METER_VALUE_COUNTER = "counter"

	METER_VALUE_SUMMARY = "summary"

	METER_VALUE_TIMER = "timer"

	STATISTIC_VALUE_COUNT = "count"

	STATISTIC_VALUE_TOTAL = "total"

	STATISTIC_VALUE_TPS = "tps"

	STATISTIC_VALUE_MAX = "max"

	STATISTIC_VALUE_AVERAGE = "average"

	STATUS_VALUE_ACTIVE = "active"

	STATUS_VALUE_COMMITTED = "committed"

	STATUS_VALUE_ROLLBACKED = "rollbacked"
)
View Source
var (
	COUNTER_ACTIVE = &Counter{
		Counter: metrics.NewCounter(),
		Name:    SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_COUNTER,
			STATUS_KEY: STATUS_VALUE_ACTIVE,
		},
	}
	COUNTER_COMMITTED = &Counter{
		Counter: metrics.NewCounter(),
		Name:    SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_COUNTER,
			STATUS_KEY: STATUS_VALUE_COMMITTED,
		},
	}
	COUNTER_ROLLBACKED = &Counter{
		Counter: metrics.NewCounter(),
		Name:    SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_COUNTER,
			STATUS_KEY: STATUS_VALUE_ROLLBACKED,
		},
	}
	SUMMARY_COMMITTED = &Summary{
		Meter: metrics.NewMeter(),
		Name:  SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_SUMMARY,
			STATUS_KEY: STATUS_VALUE_COMMITTED,
		},
	}
	SUMMARY_ROLLBACKED = &Summary{
		Meter: metrics.NewMeter(),
		Name:  SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_SUMMARY,
			STATUS_KEY: STATUS_VALUE_ROLLBACKED,
		},
	}
	TIMER_COMMITTED = &Histogram{
		Histogram: metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015)),
		Name:      SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_TIMER,
			STATUS_KEY: STATUS_VALUE_COMMITTED,
		},
	}
	TIMER_ROLLBACK = &Histogram{
		Histogram: metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015)),
		Name:      SEATA_TRANSACTION,
		Labels: map[string]string{
			ROLE_KEY:   ROLE_VALUE_TC,
			METER_KEY:  METER_VALUE_TIMER,
			STATUS_KEY: STATUS_VALUE_ROLLBACKED,
		},
	}
)

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 MetricsSubscriber

type MetricsSubscriber struct {
}

func (*MetricsSubscriber) ProcessGlobalTransactionEvent

func (subscriber *MetricsSubscriber) 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