aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc
diff options
context:
space:
mode:
authorPim van den Berg2014-04-06 16:44:14 +0200
committerPim van den Berg2014-04-06 16:44:14 +0200
commitebc6422aa4d6250b4c4adae14954dcc00a86d67f (patch)
treee2cdca0e74d3a07cf54a9fba942a0c20bc573812 /inc
parentadd SVG graph support (diff)
downloadapt-panopticon_cgp-ebc6422aa4d6250b4c4adae14954dcc00a86d67f.zip
apt-panopticon_cgp-ebc6422aa4d6250b4c4adae14954dcc00a86d67f.tar.gz
apt-panopticon_cgp-ebc6422aa4d6250b4c4adae14954dcc00a86d67f.tar.bz2
apt-panopticon_cgp-ebc6422aa4d6250b4c4adae14954dcc00a86d67f.tar.xz
overview: only calculate cores when config option showload is enabled
Closes: https://github.com/pommi/CGP/issues/60
Diffstat (limited to 'inc')
-rw-r--r--inc/html.inc.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php
index e6c6f6d..b4d295a 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -191,8 +191,6 @@ function host_summary($cat, $hosts) {
191 foreach($hosts as $host) { 191 foreach($hosts as $host) {
192 $host_counter++; 192 $host_counter++;
193 193
194 $cores = count(group_plugindata(collectd_plugindata($host, 'cpu')));
195
196 printf('<tr class="%s">', $row_style[$host_counter % 2]); 194 printf('<tr class="%s">', $row_style[$host_counter % 2]);
197 printf('<th><a href="%shost.php?h=%s">%s</a></th>', 195 printf('<th><a href="%shost.php?h=%s">%s</a></th>',
198 $CONFIG['weburl'],$host, $host); 196 $CONFIG['weburl'],$host, $host);
@@ -209,6 +207,8 @@ function host_summary($cat, $hosts) {
209 isset($rrd_info['ds[midterm].last_ds']) && 207 isset($rrd_info['ds[midterm].last_ds']) &&
210 isset($rrd_info['ds[longterm].last_ds'])) { 208 isset($rrd_info['ds[longterm].last_ds'])) {
211 209
210 $cores = count(group_plugindata(collectd_plugindata($host, 'cpu')));
211
212 foreach (array('ds[shortterm].last_ds', 'ds[midterm].last_ds', 'ds[longterm].last_ds') as $info) { 212 foreach (array('ds[shortterm].last_ds', 'ds[midterm].last_ds', 'ds[longterm].last_ds') as $info) {
213 $class = ''; 213 $class = '';
214 if ($cores > 0 && $rrd_info[$info] > $cores * 2) 214 if ($cores > 0 && $rrd_info[$info] > $cores * 2)