// decodeStatusHealth decodes the health portion of the output of 'ceph status'
433790
func decodeStatusHealth(acc telegraf.Accumulator, data *CephStatus) error {
	fields := map[string]interface{}{
		"status":         data.Health.Status,
		"overall_status": data.Health.OverallStatus,
	}
	acc.AddFields("ceph_health", fields, map[string]string{})
	return nil
}
735301
func decodeStatusPgmap(acc telegraf.Accumulator, data *CephStatus) error {
	fields := map[string]interface{}{
		"version":          data.PGMap.Version,
		"num_pgs":          data.PGMap.NumPGs,
		"data_bytes":       data.PGMap.DataBytes,
		"bytes_used":       data.PGMap.BytesUsed,
		"bytes_avail":      data.PGMap.BytesAvail,
		"bytes_total":      data.PGMap.BytesTotal,
		"read_bytes_sec":   data.PGMap.ReadBytesSec,
		"write_bytes_sec":  data.PGMap.WriteBytesSec,
		"op_per_sec":       data.PGMap.OpPerSec, // This field is no longer reported in ceph 10 and later
		"read_op_per_sec":  data.PGMap.ReadOpPerSec,
		"write_op_per_sec": data.PGMap.WriteOpPerSec,
	}
	acc.AddFields("ceph_pgmap", fields, map[string]string{})
	return nil
}
1217115
func (s *Instance) SetHealthStatus(v string) *Instance {
	s.HealthStatus = &v
	return s
}
663539
func (s *LoadBalancerDescription) SetHealthCheck(v *HealthCheck) *LoadBalancerDescription {
	s.HealthCheck = v
	return s
}
745614
func (s *CreateEndpointGroupInput) SetHealthCheckProtocol(v string) *CreateEndpointGroupInput {
	s.HealthCheckProtocol = &v
	return s
}
1178000
func (s *UpdateHealthCheckInput) SetHealthCheckId(v string) *UpdateHealthCheckInput {
	s.HealthCheckId = &v
	return s
}
1065009
func (s *ModifyTargetGroupInput) SetHealthCheckProtocol(v string) *ModifyTargetGroupInput {
	s.HealthCheckProtocol = &v
	return s
}
455255
func restGetServicesHealth(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
	healthStatuses, err := ctx.getFacade().GetServicesHealth(ctx.getDatastoreContext())
	if err != nil {
		glog.Errorf("Could not get services health: %s", err)
		restServerError(w, err)
		return
	}

	w.WriteJson(struct {
		Timestamp int64
		Statuses  map[string]map[int]map[string]health.HealthStatus
	}{
		Timestamp: time.Now().UTC().Unix(),
		Statuses:  healthStatuses,
	})
	return
}
441682
func (s *GetHealthCheckLastFailureReasonInput) SetHealthCheckId(v string) *GetHealthCheckLastFailureReasonInput {
	s.HealthCheckId = &v
	return s
}
107703
func (s *DescribeEnvironmentHealthOutput) SetHealthStatus(v string) *DescribeEnvironmentHealthOutput {
	s.HealthStatus = &v
	return s
}
1184081
func (s *AgentInfo) SetHealth(v string) *AgentInfo {
	s.Health = &v
	return s
}
1044001
func PathIsHealthy(cp *models.PathStatus) bool {
	if cp == nil {
		return false
	}

	statuses := []*models.ConnectivityStatus{
		cp.Icmp,
		cp.HTTP,
	}
	for _, status := range statuses {
		if !connectivityStatusHealthy(status) {
			return false
		}
	}
	return true
}
651764
func decodeStatusPgmapState(acc telegraf.Accumulator, data *CephStatus) error {
	for _, pgState := range data.PGMap.PGsByState {
		tags := map[string]string{
			"state": pgState.StateName,
		}
		fields := map[string]interface{}{
			"count": pgState.Count,
		}
		acc.AddFields("ceph_pgmap_state", fields, tags)
	}
	return nil
}
920724
func (g *Cloud) DeleteHTTPSHealthCheck(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newHealthcheckMetricContext("delete_legacy")
	return mc.Observe(g.c.HttpsHealthChecks().Delete(ctx, meta.GlobalKey(name)))
}
690116
func (f *Facade) GetServiceHealth(ctx datastore.Context, serviceID string) (map[int]map[string]health.HealthStatus, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetServiceHealth"))
	store := f.serviceStore
	sh, err := store.GetServiceHealth(ctx, serviceID)
	if err != nil {
		glog.Errorf("Could not look up service %s: %s", serviceID, err)
		return nil, err
	}
	return f.getServiceHealth(ctx, *sh)
}
647583
func (s *ConfigureHealthCheckOutput) SetHealthCheck(v *HealthCheck) *ConfigureHealthCheckOutput {
	s.HealthCheck = v
	return s
}
833332
func (s *SeesawEngine) HealthState(args *healthcheck.HealthState, reply *int) error {
	if args == nil {
		return errors.New("args is nil")
	}
	ctx := args.Ctx
	s.trace("HealthState", ctx)
	if ctx == nil {
		return errors.New("context is nil")
	}

	if !ctx.IsTrusted() {
		return errors.New("insufficient access")
	}

	for _, n := range args.Notifications {
		if err := s.engine.hcManager.healthState(n); err != nil {
			return err
		}
	}

	return nil
}