util

package
v7.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MinSchedulerInterval is the minimum interval between two scheduling.
	MinSchedulerInterval = atomic.NewDuration(200 * time.Millisecond)
)

Functions

This section is empty.

Types

type Component

type Component int

Component is ID for difference component

const (
	// UNKNOWN is for unknown component. It is only for test
	UNKNOWN Component = iota
	// DDL is for ddl component
	DDL
)

type GoroutinePool

type GoroutinePool interface {
	ReleaseAndWait()
	Tune(size int)
	LastTunerTs() time.Time
	Cap() int
	Running() int
	Name() string
}

GoroutinePool is a pool interface

type MockGPool

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

MockGPool is only for test

func NewMockGPool

func NewMockGPool(name string) *MockGPool

NewMockGPool is only for test

func (*MockGPool) Cap

func (*MockGPool) Cap() int

Cap is only for test

func (*MockGPool) GetQueueSize

func (*MockGPool) GetQueueSize() int64

GetQueueSize is only for test

func (*MockGPool) InFlight

func (*MockGPool) InFlight() int64

InFlight is only for test

func (*MockGPool) LastTunerTs

func (*MockGPool) LastTunerTs() time.Time

LastTunerTs is only for test

func (*MockGPool) LongRTT

func (*MockGPool) LongRTT() float64

LongRTT is to represent the baseline latency by tracking a measurement of the long term, less volatile RTT.

func (*MockGPool) MaxInFlight

func (*MockGPool) MaxInFlight() int64

MaxInFlight is only for test

func (*MockGPool) MaxPASS

func (*MockGPool) MaxPASS() uint64

MaxPASS is only for test

func (*MockGPool) MinRT

func (*MockGPool) MinRT() uint64

MinRT is only for test

func (*MockGPool) Name

func (m *MockGPool) Name() string

Name is only for test

func (*MockGPool) ReleaseAndWait

func (*MockGPool) ReleaseAndWait()

ReleaseAndWait is only for test

func (*MockGPool) Running

func (*MockGPool) Running() int

Running is only for test

func (*MockGPool) ShortRTT

func (*MockGPool) ShortRTT() uint64

ShortRTT is to represent the current system latency by tracking a measurement of the short time, and more volatile RTT.

func (*MockGPool) Tune

func (*MockGPool) Tune(_ int)

Tune is only for test

func (*MockGPool) UpdateLongRTT

func (*MockGPool) UpdateLongRTT(_ func(float64) float64)

UpdateLongRTT is only for test

type PoolContainer

type PoolContainer struct {
	Pool      GoroutinePool
	Component Component
}

PoolContainer is a pool container

type ShardPoolMap

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

ShardPoolMap is a map with shard

func NewShardPoolMap

func NewShardPoolMap() *ShardPoolMap

NewShardPoolMap creates a shard pool map

func (*ShardPoolMap) Add

func (s *ShardPoolMap) Add(key string, pool *PoolContainer) error

Add adds a pool to the map

func (*ShardPoolMap) Del

func (s *ShardPoolMap) Del(key string)

Del deletes a pool to the map.

func (*ShardPoolMap) Iter

func (s *ShardPoolMap) Iter(fn func(pool *PoolContainer))

Iter iterates the map

Jump to

Keyboard shortcuts

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