$state) { $modules[$module]['state'] = $state; } $total_time = 0; foreach ($cache_times_db as $cache_time) { $cache_time['device_state'] = safe_unserialize($cache_time['device_state']); $cache_times[$cache_time['device_id']] = $cache_time; foreach ($cache_time['device_state']['poller_mod_perf'] as $module => $time) { $modules[$module]['time'] += $time; $total_time += $time; } } foreach ($modules as $module => $data) { if (isset($data['time'])) { $modules[$module]['perc'] = round(float_div($data['time'], $total_time) * 100, 2); } else { $modules[$module]['perc'] = 0; } } // r($modules); // r($cache_times); $modules = array_sort($modules, 'time', 'SORT_DESC'); echo generate_box_open(); echo ' '; foreach ($modules as $module => $data) { $bar_bg = get_percentage_colours($data['perc']); echo ''; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ''; } echo '
Module Description Status Description Total Time
' . $module . '' . ($data['state'] == 1 ? 'enabled' : 'disabled') . '' . (isset($modules[$module]['time']) ? round($modules[$module]['time'], 2) . 's' : '-') . '' . print_percentage_bar('100%', '20', $data['perc'], $data['perc'] . '%', "ffffff", $bar_bg['left'], '', "ffffff", $bar_bg['right']) . '
'; echo generate_box_close(); // EOF