diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2008-12-24 21:44:44 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2008-12-24 21:44:44 +0000 |
commit | ddc26847ae6d647f13f6d105618775707d6fe486 (patch) | |
tree | 8795c6811afdfa1f2eeb70877bedaec1ecb0b233 /etc/inc/rrd.inc | |
parent | 7e50413caa592eb4b9b8cd7e2c930af5c85ac1a2 (diff) | |
download | pfsense-ddc26847ae6d647f13f6d105618775707d6fe486.zip pfsense-ddc26847ae6d647f13f6d105618775707d6fe486.tar.gz |
Final attempt at making rows merger work before I throw in the towel.
Empty rows need to proceed the old data when growing the RRA archive
Diffstat (limited to 'etc/inc/rrd.inc')
-rw-r--r-- | etc/inc/rrd.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index 1e17840..16caa1e 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -106,6 +106,16 @@ function migrate_rrd_format($rrdoldxml, $rrdnewxml) { $k = 0; $rowcountold = count($rrdoldxml['rra'][$i]['database']['row']); $rowcountnew = count($rrdnewxml['rra'][$i]['database']['row']); + $rowcountdiff = $rowcountnew - $rowcountold; + /* save old rows for a bit before we put the required empty rows before it */ + $rowsdata = $rows; + $rowsempty = array(); + $r = 0; + while($r < $rowcountdiff) + $rowsempty[] = $rrdnewxml['rra'][$i]['database']['row'][$r]; + $r++; + } + $rows = $rowsempty + $rowsdata; /* now foreach the rows in the database */ foreach($rows['row'] as $row) { if(!is_array($rrdoldxml['rra'][$i]['database']['row'][$k])) { |