func (cs *clientServer) publishHealthMetrics() {
	if cs.publishTicker == nil {
		seelog.Debug("Skipping publishing health metrics. Publish ticker is uninitialized")
		return
	}

	// Publish metrics immediately after we connect and wait for ticks. This makes
	// sure that there is no data loss when a scheduled metrics publishing fails
	// due to a connection reset.
	err := cs.publishHealthMetricsOnce()
	if err != nil {
		seelog.Warnf("Unable to publish health metrics: %v", err)
	}
	for {
		select {
		case <-cs.publishHealthTicker.C:
			err := cs.publishHealthMetricsOnce()
			if err != nil {
				seelog.Warnf("Unable to publish health metrics: %v", err)
			}
		case <-cs.ctx.Done():
			return
		}
	}
}
func (cs *clientServer) publishHealthMetrics() {
	if cs.publishTicker == nil {
		seelog.Debug("Skipping publishing health metrics. Publish ticker is uninitialized")
		return
	}

	
	
	
	err := cs.publishHealthMetricsOnce()
	if err != nil {
		seelog.Warnf("Unable to publish health metrics: %v", err)
	}
	for {
		select {
		case <-cs.publishHealthTicker.C:
			err := cs.publishHealthMetricsOnce()
			if err != nil {
				seelog.Warnf("Unable to publish health metrics: %v", err)
			}
		case <-cs.ctx.Done():
			return
		}
	}
}
func ( cs * clientServer ) publishHealthMetrics ( ) { if cs . publishTicker == nil { seelog . Debug ( " " ) return } // Publish metrics immediately after we connect and wait for ticks. This makes // sure that there is no data loss when a scheduled metrics publishing fails // due to a connection reset. err := cs . publishHealthMetricsOnce ( ) if err != nil { seelog . Warnf ( " " , err ) } for { select { case <- cs . publishHealthTicker . C : err := cs . publishHealthMetricsOnce ( ) if err != nil { seelog . Warnf ( " " , err ) } case <- cs . ctx . Done ( ) : return } } }
// publishHealthMetrics send the container health information to backend
publishHealthMetrics send the container health information to backend