// Progress indicates a callback that will be called while indexing.
767901
func (ix *Reindexer) Progress(f ReindexerProgressFunc) *Reindexer {
	ix.progress = f
	return ix
}
614866
func (shardSwap *shardSchemaSwap) markPropagationInProgress() {
	shardSwap.propagationUINode.Message = ""
	shardSwap.propagationUINode.State = workflowpb.WorkflowState_Running
	shardSwap.propagationUINode.Display = workflow.NodeDisplayDeterminate
	shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */)
}
899698
func handleProgress(ch <-chan *migrator.ProgressUpdate, doneCh <-chan struct{}) {
	var lastOp string
	var lastProgress float64
	lastFlush := time.Now()
	for {
		select {
		case update := <-ch:
			switch {
			case lastOp != update.Op:
				lastProgress = update.Progress
				lastOp = update.Op
				fmt.Println(update.Op)
				fmt.Printf("%.2f%%\n", update.Progress)

			case update.Progress-lastProgress >= 5:
				fallthrough

			case time.Now().Sub(lastFlush) > time.Second:
				fallthrough

			case update.Progress == 100:
				lastFlush = time.Now()
				lastProgress = update.Progress
				fmt.Printf("%.2f%%\n", update.Progress)
			}
		case <-doneCh:
			return
		}
	}
}
1216443
func WithProgress(pl ProgressTracker) func(*Client) error {
	return func(c *Client) error {
		c.ProgressListener = pl
		return nil
	}
}
150649
func (views *views) Progress(isKeyTouching bool) {
	if !views.isDead {
		return
	}

	views.move()

	_, py := views.ball.getPosition()
	if py == 0 {
		if views.elapsedDeadFrame > waitFrameAfterDead {
			for _, v := range views.listeners {
				v.onFinishDead()
				views.isDead = false
				views.elapsedDeadFrame = 0
			}
		} else {
			views.elapsedDeadFrame++
		}
	}
}
569006
func Progress() {
	fpsTimerContainer.Range(func(_, v interface{}) bool {
		fps := v.(*fps)
		if id, fired := fps.progress(); fired {
			fpsTimerContainer.Delete(id)
		}
		return true
	})
}
149126
func (v VMwareLease) Progress(p int) {
	v.Lease.Progress(v.Ctx, int32(p))
}
886224
func (rs *retryingSink) proceed() bool {
	return rs.failures.recent < rs.failures.threshold ||
		time.Now().UTC().After(rs.failures.last.Add(rs.failures.backoff))
}
1017984
func (out *lastProgressOutput) WriteProgress(prog progress.Progress) error {
	if !prog.LastUpdate {
		return nil
	}

	return out.output.WriteProgress(prog)
}
869060
func (b *ExponentialBackoff) Proceed(event Event) time.Duration {
	return b.backoff(atomic.LoadUint64(&b.failures))
}
152984
func (s *Store) Advance(duration time.Duration, stop <-chan struct{}) error {
	s.prevTimeMu.Lock()
	defer s.prevTimeMu.Unlock()
	newTime := s.prevTime.Add(duration)
	err := s.runOnLeader(&Command{
		Version:   CommandVersion,
		Operation: OperationSetTime,
		OldTime:   s.prevTime,
		NewTime:   newTime,
	}, stop)
	if globalclock.IsConcurrentUpdate(err) {
		// Someone else updated before us - get the new time.
		s.prevTime = s.fsm.GlobalTime()
	} else if lease.IsTimeout(err) {
		// Convert this to a globalclock timeout to match the Updater
		// interface.
		err = globalclock.ErrTimeout
	} else if err == nil {
		s.prevTime = newTime
	}
	return errors.Trace(err)
}
605917
func (e *IndexReaderExecutor) Next(ctx context.Context, req *chunk.RecordBatch) error {
	if span := opentracing.SpanFromContext(ctx); span != nil && span.Tracer() != nil {
		span1 := span.Tracer().StartSpan("tableReader.Next", opentracing.ChildOf(span.Context()))
		defer span1.Finish()
	}
	if e.runtimeStats != nil {
		start := time.Now()
		defer func() { e.runtimeStats.Record(time.Since(start), req.NumRows()) }()
	}
	err := e.result.Next(ctx, req.Chunk)
	if err != nil {
		e.feedback.Invalidate()
	}
	return err
}
651431
func (c *ProgressBar) IncrProgress() {
	if c.progress < c.total || c.allowOverflow {
		c.progress++
	}
}
2592
func (c *Consumer) ProgressLabel(label string) {
	if c != nil && c.OnProgressLabel != nil {
		c.OnProgressLabel(label)
	}
}
825522
func (p *Progress) Draw(painter *Painter) {
	painter.DrawRune(0, 0, '[')
	painter.DrawRune(p.Size().X-1, 0, ']')

	start := 1
	end := p.Size().X - 1
	curr := int((float64(p.current) / float64(p.max)) * float64(end-start))

	for i := start; i < curr; i++ {
		painter.DrawRune(i, 0, '=')
	}
	for i := curr + start; i < end; i++ {
		painter.DrawRune(i, 0, '-')
	}
	painter.DrawRune(curr, 0, '>')
}
350384
func (r ReadProgress) StartProgress() {
	r.wg.Add(1)
	go func() {
		var bytesReceived int64
		var percent int
		tick := time.NewTicker(5 * time.Second)
		defer tick.Stop()
		defer r.wg.Done()
		for {
			select {
			case b := <-r.ch:
				bytesReceived += b
				percent = int((float32(bytesReceived) / float32(r.TotalBytes)) * 100)
			case <-tick.C:
				// TODO: Preet This can return an error as well, should return it
				r.Lease.Progress(percent)
				if percent == 100 {
					return
				}
			}
		}
	}()
}
276424
func Update(out Output, id, action string) {
	out.WriteProgress(Progress{ID: id, Action: action})
}