Start records that a check has started.
(name string)
| 33 | |
| 34 | // Start records that a check has started. |
| 35 | func (p *Progress) Start(name string) { |
| 36 | p.mu.Lock() |
| 37 | defer p.mu.Unlock() |
| 38 | if p.Clock == nil { |
| 39 | p.Clock = quartz.NewReal() |
| 40 | } |
| 41 | if p.checks == nil { |
| 42 | p.checks = make(map[string]*checkStatus) |
| 43 | } |
| 44 | p.checks[name] = &checkStatus{startedAt: p.Clock.Now()} |
| 45 | } |
| 46 | |
| 47 | // Complete records that a check has finished. |
| 48 | func (p *Progress) Complete(name string) { |