// Realtime specifies whether to perform the operation in realtime or search mode.
768629
func (s *MgetService) Realtime(realtime bool) *MgetService {
	s.realtime = &realtime
	return s
}
957021
func (c *Checker) Status() Status {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	now := time.Now()

	if c.runtime.CollectedAt.Add(c.runtimeTTL).Before(now) {
		c.runtime = collect()
	}

	failures := make(map[string]string)
	for name, check := range c.checks {
		if err := check.Status(); err != nil {
			failures[name] = err.Error()
		}
	}

	status := StatusOK
	if len(failures) > 0 {
		status = StatusUnavailable
	}

	return Status{
		Status:   status,
		Time:     now,
		Since:    c.since,
		Runtime:  c.runtime,
		Metadata: c.metadata,
		Failures: failures,
	}
}
924618
func Wait(b bool) Option {
	return func(o *Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, "wait", b)
	}
}
998503
func (d Duration) Compare(o Duration) int {
	if d.Duration > o.Duration {
		return 1
	} else if d.Duration == o.Duration {
		return 0
	} else {
		return -1
	}
}
1290882
func (w *TimeWait) Done() {
	hits := atomic.LoadInt64(&w.hits)

	if hits < 0 {
		return
	}

	newhit := atomic.AddInt64(&w.hits, -1)
	if int(newhit) <= 0 {
		w.Flush()
	}
}
972649
func (t *StandardResettingTimer) Time(f func()) {
	ts := time.Now()
	f()
	t.Update(time.Since(ts))
}
899291
func (opt IteratorOptions) SeekTime() int64 {
	if opt.Ascending {
		return opt.StartTime
	}
	return opt.EndTime
}
1115842
func getWaitTime(now time.Time, maxWait time.Duration) time.Duration {
	wait := nextProvision.Sub(now) // might be negative

	// When the system clock falls back an hour, the wait time might be an hour.
	// This sanity check prevents this error.
	if wait > maxWait {
		return maxWait
	}
	if wait < 0 {
		return 0
	}
	return wait
}
1074712
func (a *ReqLatencyCounter) ModStatsTime(start time.Time) {
	totalDur := a.timeKeeper.Now().Sub(start)
	if totalDur > a.fastRequestLimitDuration.Get() {
		atomic.AddInt64(&a.slowRequests, 1)
	} else {
		atomic.AddInt64(&a.fastRequests, 1)
	}
}
330164
func (m *Mock) Now() time.Time {
	m.mu.Lock()
	defer m.mu.Unlock()
	return m.now
}
65826
func (r *realTimer) Reset(d time.Duration) bool {
	return r.timer.Reset(d)
}
698950
func Timing(sampleRate float32, bucket string, d ...time.Duration) {
	CurrentStatter.Timing(sampleRate, bucket, d...)
}
629344
func CurrentTime(value interface{}, op FieldOperation) (interface{}, error) {
	if op == PersistOperation {
		return time.Now(), nil
	} else {
		return value, nil
	}
}
1089304
func EventUpdateTimeout(timer int, freq int) {
	C.virEventUpdateTimeout((C.int)(timer), (C.int)(freq))
}
1307140
func (t *Time) Check(sc *stmtctx.StatementContext) error {
	return t.check(sc)
}
820742
func (ctx *Context) Timing(dt time.Duration, fn func(context.Context)) (err error) {
	ct, cancel := ctx.WithTimeout(dt)
	defer cancel()

	ch := make(chan error, 1) // not block tryRunTiming
	go tryRunTiming(ct, fn, ch)

	select {
	case <-ct.Done():
		err = ct.Err()
	case err = <-ch:
	}
	return
}
79533
func (m *TimerMetrics) StatusDuration(duration time.Duration) {
	if m.statusEvery == 0 {
		return
	}

	m.Lock()
	m.position++
	var looped bool
	if m.position > m.statusEvery {
		// loop back around
		looped = true
		m.position = 1
	}
	if m.position > len(m.timings) {
		m.timings = append(m.timings, duration)
	} else {
		m.timings[m.position-1] = duration
	}

	if !looped {
		m.Unlock()
		return
	}

	stats := m.getStats()
	m.Unlock()

	log.Printf("%s", stats)
}