refresher

package
v1.1.0-beta.0...-bf455f5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker

func NewWorker(statsHandle statstypes.StatsHandle, sysProcTracker sysproctrack.Tracker, maxConcurrency int) *worker

NewWorker creates a new worker.

Types

type Refresher

type Refresher struct {

	// Jobs is the priority queue of analysis jobs.
	// Exported for testing purposes.
	Jobs *priorityqueue.AnalysisPriorityQueue
	// contains filtered or unexported fields
}

Refresher provides methods to refresh stats info. NOTE: Refresher is not thread-safe.

func NewRefresher

func NewRefresher(
	statsHandle statstypes.StatsHandle,
	sysProcTracker sysproctrack.Tracker,
) *Refresher

NewRefresher creates a new Refresher and starts the goroutine.

func (*Refresher) AnalyzeHighestPriorityTables

func (r *Refresher) AnalyzeHighestPriorityTables() bool

AnalyzeHighestPriorityTables picks tables with the highest priority and analyzes them.

func (*Refresher) Close

func (r *Refresher) Close()

Close stops all running jobs and releases resources.

func (*Refresher) GetRunningJobs

func (r *Refresher) GetRunningJobs() map[int64]struct{}

GetRunningJobs returns the currently running jobs. Only used in the test.

func (*Refresher) RebuildTableAnalysisJobQueue

func (r *Refresher) RebuildTableAnalysisJobQueue() error

RebuildTableAnalysisJobQueue rebuilds the priority queue of analysis jobs.

func (*Refresher) UpdateConcurrency

func (r *Refresher) UpdateConcurrency()

UpdateConcurrency updates the maximum concurrency for auto-analyze jobs

func (*Refresher) WaitAutoAnalyzeFinishedForTest

func (r *Refresher) WaitAutoAnalyzeFinishedForTest()

WaitAutoAnalyzeFinishedForTest waits for the auto analyze job to be finished. Only used in the test.

Jump to

Keyboard shortcuts

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