Documentation ¶
Index ¶
- type ProgressBar
- func (p *ProgressBar) Completed()
- func (p *ProgressBar) FinishedJob(w int, startTime time.Time)
- func (p *ProgressBar) IncrementOverviewCurrent()
- func (p *ProgressBar) IncrementOverviewTotal()
- func (p *ProgressBar) IncrementWorkerTotal(w int, total int64)
- func (p *ProgressBar) IsEnabled() bool
- func (p *ProgressBar) IsRunning() bool
- func (p *ProgressBar) RefreshRate() time.Duration
- func (p *ProgressBar) Start(age float64)
- func (p *ProgressBar) StartJob(w int, total int64) time.Time
- func (p *ProgressBar) Wait()
- func (p *ProgressBar) WorkerCompleted(w int)
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 ¶
NewMultiProgressBar create a new progress bar to display progress of workers and an overall progress
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) WorkerCompleted ¶
func (p *ProgressBar) WorkerCompleted(w int)
WorkerCompleted marks a worker as completed. The current total will be used as its final value