Documentation
¶
Overview ¶
Package progress is the estimate's progress lines, ported from the Node estimate's packages/estimate/src/progress.ts: discovery and phase 2's CloudWatch reads (requests, uptime). With a Status (a terminal), one line rewritten in place, redrawn every second; without (a log, CI), one line per account or region done and, every minute, those still read.
This package never writes an escape code or a carriage return: the terminal Status, with those, is the entry point's.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery is the discovery phase's progress. Safe for concurrent use.
func DiscoveryView ¶
DiscoveryView starts the view for the given number of accounts; call End when discovery is over.
func (*Discovery) Account ¶
func (d *Discovery) Account(e discover.AccountEvent)
Account takes an account's started and done events (discover's AccountProgress).
func (*Discovery) Region ¶
func (d *Discovery) Region(p discover.ProgressEvent)
Region takes a region's scanned event (discover's Progress).
type Every ¶
Every runs fn every d until the returned stop is called. The default never keeps the process alive.
type Options ¶
Options are what both views take. Zero Now, Log and Every get time.Now, a no-op and Ticker; a nil Status is not a terminal.
type Regions ¶
type Regions struct {
// contains filtered or unexported fields
}
Regions is phase 2's CloudWatch reads by region. Safe for concurrent use.
func RegionsView ¶
RegionsView starts the view for label "Requests" or "Uptime"; call End when the phase is over.
func (*Regions) Done ¶
func (r *Regions) Done(p discover.ProgressEvent)
Done takes a region's read event (metrics' Progress).
func (*Regions) End ¶
func (r *Regions) End()
End stops the redraws and, if there was anything to read, leaves the last line.