// isFlapping returns true if the service is flapping (starting/stopping repeatedly).
//
// A service is considered flappping, if has been running for less than 60 seconds
// in 3 consecutive calls to this function.
975979
func (svc *IService) isFlapping() bool {
	const MINIMUM_VIABLE_LIFESPAN = 60
	const FLAPPING_THRESHOLD = 3

	upTime := time.Since(svc.startTime)
	if upTime.Seconds() < MINIMUM_VIABLE_LIFESPAN {
		svc.restartCount += 1
	} else {
		svc.restartCount = 0
	}

	return svc.restartCount >= FLAPPING_THRESHOLD
}
1149473
func IsRollingConfig(config *appsv1.DeploymentConfig) bool {
	return config.Spec.Strategy.Type == appsv1.DeploymentStrategyTypeRolling
}
333597
func (e *Executor) IsRunning(id string) (bool, error) {
	status, err := e.client.Status(context.Background(), id)
	return status == containerd.Running, err
}
1296637
func IsRunning(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {
	cli := p.Get("client", nil).(client.Client)
	count := p.Get("count", 20).(int)
	k := client.NewKeysAPI(cli)
	for i := 0; i < count; i++ {
		_, err := k.Get(dctx(), "/", &client.GetOptions{})
		if err == nil {
			return true, nil
		}
		log.Infof(c, "Waiting for etcd to come online.")
		time.Sleep(250 * time.Millisecond)
	}
	log.Errf(c, "Etcd is not answering after %d attempts.", count)
	return false, &cookoo.FatalError{"Could not connect to Etcd."}
}
1047815
func (p *StatusTable) IsRunning(name string) bool {
	p.RLock()
	defer p.RUnlock()

	return p.pool[name]
}
556287
func (nc *Conn) isDraining() bool {
	return nc.status == DRAINING_SUBS || nc.status == DRAINING_PUBS
}
890773
func (c *vaultClient) isRunning() bool {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.running
}
53420
func (c *Client) IsRunning() bool {
	c.mu.RLock()
	defer c.mu.RUnlock()
	return c.running
}
1274827
func (s *Server) isRunning() bool {
	s.mu.Lock()
	running := s.running
	s.mu.Unlock()
	return running
}
856775
func (f *Fake) IsFunction() bool {
	if f.Target == nil || f.Target.Type() == nil || f.Target.Type().Underlying() == nil {
		return false
	}
	_, ok := f.Target.Type().Underlying().(*types.Signature)
	return ok
}
310363
func (tl *TaskLogger) IsRunning() bool {
	if tl.lro != nil && tl.lro.isRunning() {
		return true
	}
	if tl.lre != nil && tl.lre.isRunning() {
		return true
	}

	return false
}
367450
func IsRunning(ep *endpoint.Endpoint) bool {
	if Client() == nil {
		return false
	}

	return Client().IsRunning(ep)
}
185740
func (p *PriorityQueue) isPodBackingOff(pod *v1.Pod) bool {
	boTime, exists := p.podBackoff.GetBackoffTime(nsNameForPod(pod))
	if !exists {
		return false
	}
	return boTime.After(p.clock.Now())
}
812571
func (ms *StatusImpl) IsPending() bool {
	ms.mutex.Lock()
	defer ms.mutex.Unlock()

	if ms.systemChannel {
		return ms.state == orderer.ConsensusType_MIG_STATE_START
	}

	return ms.state == orderer.ConsensusType_MIG_STATE_START || ms.state == orderer.ConsensusType_MIG_STATE_CONTEXT
}
193024
func (s *stackV1Beta1) IsColliding(servicesClient corev1.ServiceInterface, st Stack) error {
	for _, srv := range st.getServices() {
		if err := verify(servicesClient, st.Name, srv); err != nil {
			return err
		}
	}
	return nil
}
291646
func (p *localPrevAlloc) IsWaiting() bool {
	p.waitingLock.RLock()
	b := p.waiting
	p.waitingLock.RUnlock()
	return b
}
209576
func IsErrPUPolicyPending(err error) bool {
	switch t := err.(type) {
	case *Error:
		return t.reason == PUPolicyPending
	default:
		return false
	}
}