summaryrefslogtreecommitdiff
path: root/templates/themes/rrdtool/theme.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-06-07 22:08:40 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-06-07 22:08:40 +1000
commit7fe8e16fd616369a385ae8ecebd5be3958e5bb2a (patch)
tree8c2770408cc7b3be57d24a7220aed7bb51454107 /templates/themes/rrdtool/theme.php
parent723a2683b5f677eabda54d65d581138638cb443d (diff)
the graph was incorrect before
Diffstat (limited to 'templates/themes/rrdtool/theme.php')
-rw-r--r--templates/themes/rrdtool/theme.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/templates/themes/rrdtool/theme.php b/templates/themes/rrdtool/theme.php
index bfa5bfec..0c8c42a6 100644
--- a/templates/themes/rrdtool/theme.php
+++ b/templates/themes/rrdtool/theme.php
@@ -36,11 +36,26 @@
// Create graph
if(!rrd_create($file, Array(
'-s ' . $this->interval,
- 'DS:posts:ABSOLUTE:' . ($this->interval*2) . ':0:100000000',
- 'RRA:AVERAGE:0.5:1:2880',
- 'RRA:AVERAGE:0.5:30:672',
- 'RRA:AVERAGE:0.5:120:732',
- 'RRA:AVERAGE:0.5:720:1460')))
+ 'DS:posts:GAUGE:' . ($this->interval*2) . ':0:10000',
+
+ 'RRA:MIN:0:1:' . (3600/$this->interval), // hour
+ 'RRA:MIN:0:60:' . (86400/$this->interval), // day
+ 'RRA:MIN:0:60:' . (604800/$this->interval), // week
+ 'RRA:MIN:0:60:' . (2592000/$this->interval), // month
+ 'RRA:MIN:0:1440:' . (31536000/$this->interval), // year
+
+ 'RRA:AVERAGE:0:1:' . (3600/$this->interval), // hour
+ 'RRA:AVERAGE:0:60:' . (86400/$this->interval), // day
+ 'RRA:AVERAGE:0:60:' . (604800/$this->interval), // week
+ 'RRA:AVERAGE:0:60:' . (2592000/$this->interval), // month
+ 'RRA:AVERAGE:0:1440:' . (31536000/$this->interval), // year
+
+ 'RRA:MAX:0:1:' . (3600/$this->interval), // hour
+ 'RRA:MAX:0:60:' . (86400/$this->interval), // day
+ 'RRA:MAX:0:60:' . (604800/$this->interval), // week
+ 'RRA:MAX:0:60:' . (2592000/$this->interval), // month
+ 'RRA:MAX:0:1440:' . (31536000/$this->interval), // year
+ )))
error('RRDtool failed: ' . htmlentities(rrd_error()));
}
@@ -50,6 +65,7 @@
$query->execute() or error(db_error($query));
$count = $query->fetch();
$count = $count['count'];
+ echo 'Posts on /' . $board . '/: ' . $count . PHP_EOL;
if(!rrd_update($file, Array(
'-t',
@@ -62,7 +78,7 @@
if(!rrd_graph($settings['images'] . '/' . $board . '-' . $span . '.png', Array(
'-s -1' . $span,
'-t Posts on ' . sprintf($config['board_abbreviation'] . ' this ' . $span, $board),
- //'--lazy',
+ '--lazy',
'-l 0',
'-h', $this->height, '-w', $this->width,
'-a', 'PNG',