Documentation
¶
Overview ¶
Package progress provides helpers to print progress status.
Index ¶
Constants ¶
View Source
const ( Bytes = Type("bytes") Duration = Type("duration") Gauge = Type("gauge") )
Type values.
Variables ¶
This section is empty.
Functions ¶
func MetricsStatus ¶
MetricsStatus renders Status metrics as a string.
Types ¶
type CountingReader ¶
CountingReader wraps io.Reader to count bytes.
func (*CountingReader) Bytes ¶
func (cr *CountingReader) Bytes() int64
Bytes returns number of read bytes.
func (*CountingReader) Lines ¶
func (cr *CountingReader) Lines() int64
Lines returns number of read lines.
type CountingWriter ¶
CountingWriter wraps io.Writer to count bytes.
func (*CountingWriter) Bytes ¶
func (cr *CountingWriter) Bytes() int64
Bytes returns number of written bytes.
func (*CountingWriter) Lines ¶
func (cr *CountingWriter) Lines() int64
Lines returns number of written bytes.
type MetricsExposer ¶
type MetricsExposer interface {
Metrics() []Metric
}
MetricsExposer provides metric counters.
type Progress ¶
type Progress struct {
Interval time.Duration
Print func(status Status)
ShowHeapStats bool
ShowLinesStats bool
// contains filtered or unexported fields
}
Progress reports reading performance.
func (*Progress) AddMetrics ¶
AddMetrics adds more metrics to progress status message.
type Status ¶ added in v0.2.0
type Status struct {
Task string
DonePercent float64
LinesCompleted int64
SpeedMBPS float64
SpeedLPS float64
Elapsed time.Duration
Remaining time.Duration
Metrics []Metric
}
Status describes current progress.
Click to show internal directories.
Click to hide internal directories.