// ReportInterval returns the metrics reporting interval.
420064
func (mc *MetricsConfiguration) ReportInterval() time.Duration {
	if mc.RootScope != nil && mc.RootScope.ReportingInterval != 0 {
		return mc.RootScope.ReportingInterval
	}
	return defaultReportingInterval
}
992815
func WithPollingInterval(interval time.Duration) PollerConfigOption {
	return PollerConfigOption(func(c *Poller) {
		c.interval = interval
	})
}
676722
func (s *Service) reportLatency(conn *websocket.Conn) error {
	// Send the current time to the ethstats server
	start := time.Now()

	ping := map[string][]interface{}{
		"emit": {"node-ping", map[string]string{
			"id":         s.node,
			"clientTime": start.String(),
		}},
	}
	if err := websocket.JSON.Send(conn, ping); err != nil {
		return err
	}
	// Wait for the pong request to arrive back
	select {
	case <-s.pongCh:
		// Pong delivered, report the latency
	case <-time.After(5 * time.Second):
		// Ping timeout, abort
		return errors.New("ping timed out")
	}
	latency := strconv.Itoa(int((time.Since(start) / time.Duration(2)).Nanoseconds() / 1000000))

	// Send back the measured latency
	log.Trace("Sending measured latency to ethstats", "latency", latency)

	stats := map[string][]interface{}{
		"emit": {"latency", map[string]string{
			"id":      s.node,
			"latency": latency,
		}},
	}
	return websocket.JSON.Send(conn, stats)
}
795699
func (f *Request) InitialInterval(t time.Duration) *Request {
	f.backoff.InitialInterval = t
	return f
}
41106
func (samplerOptions) SamplingRefreshInterval(samplingRefreshInterval time.Duration) SamplerOption {
	return func(o *samplerOptions) {
		o.samplingRefreshInterval = samplingRefreshInterval
	}
}
687285
func (i Interval) ContainsInterval(oi Interval) bool {
	if oi.IsEmpty() {
		return true
	}
	return i.Lo <= oi.Lo && oi.Hi <= i.Hi
}
543563
func logStats(stats *responseStats, interval uint) {
	logrus.Debugf("Initializing stats reporting. Will print stats once/%d seconds", interval)
	if interval == 0 {
		// interval of 0 means don't print summary status
		return
	}
	ticker := time.NewTicker(time.Second * time.Duration(interval))
	for range ticker.C {
		stats.logAndReset()
	}
}
430759
func (s *ModifyDBInstanceInput) SetMonitoringInterval(v int64) *ModifyDBInstanceInput {
	s.MonitoringInterval = &v
	return s
}
1283047
func PollInterval(i time.Duration) Option {
	return func(o *Options) {
		o.PollInterval = i
	}
}
3595
func (r *Reporter) Report(ctx context.Context) {
	logger := r.Logger.With(
		zap.String("service", "telemetry"),
		influxlogger.DurationLiteral("interval", r.Interval),
	)

	logger.Info("Starting")
	if err := r.Pusher.Push(ctx); err != nil {
		logger.Debug("failure reporting telemetry metrics", zap.Error(err))
	}

	ticker := time.NewTicker(r.Interval)
	defer ticker.Stop()
	for {
		select {
		case <-ticker.C:
			logger.Debug("Reporting")
			if err := r.Pusher.Push(ctx); err != nil {
				logger.Debug("failure reporting telemetry metrics", zap.Error(err))
			}
		case <-ctx.Done():
			logger.Info("Stopping")
			return
		}
	}
}
192599
func BreakerInterval(interval time.Duration) Option {
	return func(r *Rabbus) error {
		r.config.breaker.interval = interval
		return nil
	}
}
264117
func (t *migrateTracker) report(prefix string, info *resource.Info, err error) {
	ns := info.Namespace
	if len(ns) > 0 {
		ns = " -n " + ns
	}
	groupResource := info.Mapping.Resource.GroupResource()
	groupResourceStr := (&groupResource).String()
	if err != nil {
		fmt.Fprintf(t.out, "E%s %-10s%s %s/%s: %v\n", timeStampNow(), prefix, ns, groupResourceStr, info.Name, err)
	} else {
		fmt.Fprintf(t.out, "I%s %-10s%s %s/%s\n", timeStampNow(), prefix, ns, groupResourceStr, info.Name)
	}
}
493167
func (i Interval) ContainsInterval(oi Interval) bool {
	if i.IsInverted() {
		if oi.IsInverted() {
			return oi.Lo >= i.Lo && oi.Hi <= i.Hi
		}
		return (oi.Lo >= i.Lo || oi.Hi <= i.Hi) && !i.IsEmpty()
	}
	if oi.IsInverted() {
		return i.IsFull() || oi.IsEmpty()
	}
	return oi.Lo >= i.Lo && oi.Hi <= i.Hi
}
175989
func (s *server) SetHeartbeatInterval(duration time.Duration) {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	s.heartbeatInterval = duration
	for _, peer := range s.peers {
		peer.setHeartbeatInterval(duration)
	}
}
1359715
func (p *PodHealthCheck) SetInterval(intervalSeconds int) *PodHealthCheck {
	p.IntervalSeconds = &intervalSeconds
	return p
}
898453
func (s *Scheduler) ReportingDelay(delay time.Duration) {
	atomic.StoreInt64(&s.ReportingDelayNs, delay.Nanoseconds())
}
1021218
func (mc MongoClient) getIntervals(q bson.M) ([]models.Interval, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	var mi []models.Interval
	if err := s.DB(mc.database.Name).C(db.Interval).Find(q).All(&mi); err != nil {
		return []models.Interval{}, errorMap(err)
	}
	return mi, nil
}