collector

package
v0.0.0-...-17003a6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTDigestCollectorBuilder

func NewTDigestCollectorBuilder(mode string) func() Collector

NewTDigestCollectorBuilder create Collector by mode.

Types

type Collector

type Collector interface {
	// Type return the types of collector
	Type() string

	// Add append result to statistic
	Add(*fcom.Result)

	// Serialize generate serialized data to pass through network in remote mode
	Serialize() []byte

	// Merge merge serialized data
	Merge([]byte) error

	// MergeC try to merge a Collector, if it can not do this, just raise a error
	MergeC(Collector) error

	// Get get current statistic data group by label
	Get() *fcom.Data

	// Reset reset data should reset the time window and clean data
	Reset()
}

Collector is used to collect result and generate statistic data group by label Collector may not be implement concurrently safe, so you should receive data in a goroutine

func NewTDigestDetailsCollector

func NewTDigestDetailsCollector() Collector

NewTDigestDetailsCollector new TDigestDetailsCollector and return.

func NewTDigestSummaryCollector

func NewTDigestSummaryCollector() Collector

NewTDigestSummaryCollector create TDigestSummaryCollector.

type Details

type Details struct {
	Label          string
	Num            int
	SendLatency    *TDigest
	ConfirmLatency *TDigest
	WriteLatency   *TDigest
	Status         map[fcom.Status]int
}

Details detail info for statistic.

func NewDetails

func NewDetails(label string) *Details

NewDetails create a Details and return.

type TDigest

type TDigest struct {
	*tdigest.TDigest
}

TDigest defined for use tdigest.TDigest.

func NewTDigest

func NewTDigest() *TDigest

NewTDigest create TDigest and return.

func (*TDigest) MarshalJSON

func (t *TDigest) MarshalJSON() ([]byte, error)

MarshalJSON implement Marshaler.

func (*TDigest) UnmarshalJSON

func (t *TDigest) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implement Unmarshaler.

type TDigestDetailsCollector

type TDigestDetailsCollector struct {
	Data map[string]*Details
	Time int64
}

TDigestDetailsCollector is the implement of Collector processing result in detail

func (*TDigestDetailsCollector) Add

func (t *TDigestDetailsCollector) Add(result *fcom.Result)

Add append result to statistic

func (*TDigestDetailsCollector) Get

func (t *TDigestDetailsCollector) Get() *fcom.Data

Get get current statistic data group by label

func (*TDigestDetailsCollector) Merge

func (t *TDigestDetailsCollector) Merge(bs []byte) (err error)

Merge merge serialized data

func (*TDigestDetailsCollector) MergeC

func (t *TDigestDetailsCollector) MergeC(collector Collector) (err error)

MergeC try to merge a Collector, if it can not do this, just raise a error

func (*TDigestDetailsCollector) Reset

func (t *TDigestDetailsCollector) Reset()

Reset reset data should reset the time window and clean data.

func (*TDigestDetailsCollector) Serialize

func (t *TDigestDetailsCollector) Serialize() []byte

Serialize generate serialized data to pass through network in remote mode

func (*TDigestDetailsCollector) Type

func (t *TDigestDetailsCollector) Type() string

Type return the types of collector

type TDigestSummaryCollector

type TDigestSummaryCollector struct {
	Data *Details
	Time int64
}

TDigestSummaryCollector is the implement of Collector processing result in summary

func (*TDigestSummaryCollector) Add

func (t *TDigestSummaryCollector) Add(result *fcom.Result)

Add append result to statistic

func (*TDigestSummaryCollector) Get

func (t *TDigestSummaryCollector) Get() *fcom.Data

Get get current statistic data group by label

func (*TDigestSummaryCollector) Merge

func (t *TDigestSummaryCollector) Merge(bytes []byte) (err error)

Merge merge serialized data

func (*TDigestSummaryCollector) MergeC

func (t *TDigestSummaryCollector) MergeC(collector Collector) (err error)

MergeC try to merge a Collector, if it can not do this, just raise a error

func (*TDigestSummaryCollector) Reset

func (t *TDigestSummaryCollector) Reset()

Reset reset data should reset the time window and clean data.

func (*TDigestSummaryCollector) Serialize

func (t *TDigestSummaryCollector) Serialize() []byte

Serialize generate serialized data to pass through network in remote mode

func (*TDigestSummaryCollector) Type

func (t *TDigestSummaryCollector) Type() string

Type return the types of collector

Jump to

Keyboard shortcuts

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