MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / calculate_system_health

Function calculate_system_health

pengine/allocate.c:651–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651static void
652calculate_system_health(gpointer gKey, gpointer gValue, gpointer user_data)
653{
654 const char *key = (const char *)gKey;
655 const char *value = (const char *)gValue;
656 int *system_health = (int *)user_data;
657
658 if (!gKey || !gValue || !user_data) {
659 return;
660 }
661
662 /* Does it start with #health? */
663 if (0 == strncmp(key, "#health", 7)) {
664 int score;
665
666 /* Convert the value into an integer */
667 score = char2score(value);
668
669 /* Add it to the running total */
670 *system_health = merge_weights(score, *system_health);
671 }
672}
673
674static gboolean
675apply_system_health(pe_working_set_t * data_set)

Callers

nothing calls this directly

Calls 2

char2scoreFunction · 0.85
merge_weightsFunction · 0.85

Tested by

no test coverage detected