chanjet

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

Chanjet

Go Version License Performance
Go Report

High-Performance double-buffered channel using Go slice, buffer pool and zero-copy.

Documentation

Index

Constants

View Source
const (
	WritingStatus = iota
	PendingStatus
	ClosedStatus
)
View Source
const (
	SizeWeight   float64 = 0.6
	TimeWeight   float64 = 0.4
	FullCapacity float64 = 0.85
)
View Source
const MinBufferSize = 1
View Source
const Unknown = "unknown"

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorType added in v1.0.4

type CollectorType int
const (
	PrometheusCollector CollectorType = iota
	OpenTelemetryCollector
)

func (CollectorType) String added in v1.0.4

func (c CollectorType) String() string

func (CollectorType) Validate added in v1.0.4

func (c CollectorType) Validate() bool

type DefaultStrategy added in v1.0.4

type DefaultStrategy struct{}

func (*DefaultStrategy) NeedSwitch added in v1.0.4

func (d *DefaultStrategy) NeedSwitch(currentCount, bufferSize int32, elapsed, interval time.Duration) bool

type OperationType added in v1.0.4

type OperationType int
const (
	MetricsIncOp OperationType = iota
	MetricsDecOp
)

type ReadMode added in v1.0.4

type ReadMode int
const (
	SafeRead ReadMode = iota + 1
	ZeroCopyRead
)

func (ReadMode) String added in v1.0.4

func (m ReadMode) String() string

func (ReadMode) Validate added in v1.0.4

func (m ReadMode) Validate() bool

type SizeOnlyStrategy added in v1.0.4

type SizeOnlyStrategy struct{}

func (*SizeOnlyStrategy) NeedSwitch added in v1.0.4

func (s *SizeOnlyStrategy) NeedSwitch(currentCount, bufferSize int32, _, _ time.Duration) bool

type SwitchStatus added in v1.0.4

type SwitchStatus int
const (
	SwitchSuccess SwitchStatus = iota
	SwitchFailure
	SwitchSkip
)

func (SwitchStatus) String added in v1.0.4

func (s SwitchStatus) String() string

type SwitchStrategy added in v1.0.4

type SwitchStrategy interface {
	NeedSwitch(currentCount, bufferSize int32, elapsed, interval time.Duration) bool
}

func NewDefaultStrategy added in v1.0.4

func NewDefaultStrategy() SwitchStrategy

func NewSizeOnlyStrategy added in v1.0.4

func NewSizeOnlyStrategy() SwitchStrategy

func NewTimeWindowOnlyStrategy added in v1.0.4

func NewTimeWindowOnlyStrategy() SwitchStrategy

type TimeWindowOnlyStrategy added in v1.0.4

type TimeWindowOnlyStrategy struct{}

func (*TimeWindowOnlyStrategy) NeedSwitch added in v1.0.4

func (s *TimeWindowOnlyStrategy) NeedSwitch(_, _ int32, elapsed, interval time.Duration) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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