progressbar

package
v2.39.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgressBar

type ProgressBar struct {
	Bars     []*mpb.Bar
	TaskName string
	NumBars  int
	// contains filtered or unexported fields
}

ProgressBar Multi progress bar

func NewMultiProgressBar

func NewMultiProgressBar(w io.Writer, total, numBars int, name string, enable bool) *ProgressBar

NewMultiProgressBar create a new progress bar to display progress of workers and an overall progress

func (*ProgressBar) Completed

func (p *ProgressBar) Completed()

Completed set overall completed

func (*ProgressBar) FinishedJob

func (p *ProgressBar) FinishedJob(w int, startTime time.Time)

FinishedJob finish a job and record the time since the job started (if StartJob was called)

func (*ProgressBar) IncrementOverviewCurrent

func (p *ProgressBar) IncrementOverviewCurrent()

IncrementOverviewTotal increment the current overview value by 1

func (*ProgressBar) IncrementOverviewTotal

func (p *ProgressBar) IncrementOverviewTotal()

IncrementOverviewTotal increment the overview total by 1

func (*ProgressBar) IncrementWorkerTotal

func (p *ProgressBar) IncrementWorkerTotal(w int, total int64)

IncrementWorkerTotal increments the worker total by 1

func (*ProgressBar) IsEnabled

func (p *ProgressBar) IsEnabled() bool

IsEnabled check if the progress bar is enabled or not.

func (*ProgressBar) IsRunning

func (p *ProgressBar) IsRunning() bool

IsRunning check if the progress bar is running or not (aka. has started)

func (*ProgressBar) RefreshRate

func (p *ProgressBar) RefreshRate() time.Duration

RefreshRate returns the configured refresh rate of the progress bar

func (*ProgressBar) Start

func (p *ProgressBar) Start(age float64)

Start start displaying the progress bar

func (*ProgressBar) StartJob

func (p *ProgressBar) StartJob(w int, total int64) time.Time

StartJob starts a job for a given worker. It will record the time it started the job, and the duration will be used in calculated once FinishedJob is called.

func (*ProgressBar) Wait

func (p *ProgressBar) Wait()

Wait waits for the progress bar to finish

func (*ProgressBar) WorkerCompleted

func (p *ProgressBar) WorkerCompleted(w int)

WorkerCompleted marks a worker as completed. The current total will be used as its final value

Jump to

Keyboard shortcuts

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