function print_gauges() { global $overviewData; $web_eu = $overviewData['web_eu']; $dataArr = array("web_mem" => $web_eu['memory'], "web_cpu" => $web_eu['cpu'], "web_rps" => $overviewData['web_rps']); $threshold = array("web_mem" => 80, "web_cpu" => 90); foreach ($dataArr as $key => $data) { $curr = $data['current']; $prev = $data['previous']; $diff = $curr - $prev; $label = $data['label']; $highest = $data['max']; echo '<div class="gauge-wrapper left">'; if ($key == "web_rps") { //no percentage, no color coding print_gauge2($key, $label, $curr, 0, 500, $highest); } else { print_gauge($key, $label, $curr, 0, 100, 40, $threshold[$key], $highest); print_arrow($curr - $prev); } echo '</div>'; if ($key != "web_rps" && $curr > $threshold[$key]) { global $warnMsgArr; $warnMsgArr[] = "Web " . $label . " has exceeded its warning threshold of " . $threshold[$key] . "%."; } } }
function print_headroom() { print_gauge("web_cpu", "Web CPU", get_eu("eu_web_chart_range", "web_cpu")); print_gauge("web_mem", "Web Memory", get_eu("eu_web_chart_range", "web_mem")); }