57 crm_debug(
"Values of node health scores: " 80 add_node_health_value(gpointer key, gpointer value, gpointer user_data)
83 struct health_sum *health_sum = user_data;
88 crm_warn(
"Ignoring %s for %s because '%s' is not a valid value: %s",
89 (
const char *) key, pcmk__node_name(health_sum->node),
95 crm_trace(
"Combined '%s' into node health score (now %s)",
112 struct health_sum health_sum = { node, base_health, };
115 g_hash_table_foreach(node->
details->
attrs, add_node_health_value,
117 return health_sum.sum;
133 const char *
name = NULL;
134 const char *value = NULL;
147 while (g_hash_table_iter_next(&iter, (gpointer *) &
name,
148 (gpointer *) &value)) {
167 "because '%s' is not a valid value: %s",
168 name, pcmk__node_name(node), value,
#define PCMK_OPT_NODE_HEALTH_GREEN
int pcmk__health_score(const char *option, const pcmk_scheduler_t *scheduler)
const char * pcmk_readable_score(int score)
Return a displayable static string for a score value.
#define PCMK_OPT_NODE_HEALTH_RED
int pe__node_health(pcmk_node_t *node)
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code.
pcmk_scheduler_t * data_set
#define crm_warn(fmt, args...)
#define crm_debug(fmt, args...)
#define crm_trace(fmt, args...)
struct pe_node_shared_s * details
int pcmk__add_scores(int score1, int score2)
#define PCMK_OPT_NODE_HEALTH_YELLOW
#define pcmk__assert(expr)
Cluster status and scheduling.
void pe__unpack_node_health_scores(pcmk_scheduler_t *scheduler)
pcmk_scheduler_t * scheduler
int pcmk_parse_score(const char *score_s, int *score, int default_score)
Parse an integer score from a string.
bool pcmk__starts_with(const char *str, const char *prefix)
Check whether a string starts with a certain sequence.
#define PCMK_VALUE_YELLOW
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
int pe__sum_node_health_scores(const pcmk_node_t *node, int base_health)