Hazaar\File
RRD
Summary
MethodsPropertiesConstants
No constants
Properties
$archiveCFs
$archiveCFs
$archives
$archives
$data
$data
$dataSourceTypes
$dataSourceTypes
$dataSources
$dataSources
$lastTick
$lastTick
$lastWrite
$lastWrite
$rrdfile
$rrdfile
$tickSec
$tickSec
$version
$version
Methods
__construct()
__construct($rrdfile, $tickSec = 60)
addArchive()
addArchive($archiveID, $cf, $xff = null, $ticks = null, $rows = null, $description = null)
addDataSource()
addDataSource($dsname, $type, $heartbeat = null, $min = null, $max = null, $description = null)
consolidate()
consolidate($cf, $dataPoints)
create()
create()
exists()
exists()
getArchiveOffset()
getArchiveOffset($archiveID = 0)
getArchiveRowLength()
getArchiveRowLength()
getArchives()
getArchives()
getDataSources()
getDataSources()
getRRDFile()
getRRDFile()
getTick()
getTick($time = null)
getTickSec()
getTickSec()
graph()
graph($dsname, $archiveID = 0)
hasDataSource()
hasDataSource($name)
restoreOptions()
restoreOptions()
setTickSec()
setTickSec($tickSec)
setValue()
setValue($dsname, $value)
update()
update()
The update function stores a consolidated data point in the archive for each data source based on the settings

supplied when defining the archive.

  • A primary data point is a single value stored for each 'tick'.
  • A consolidated data point is a value calculated based on 1 or more primary data points using the consolidation function specified when defining the archive.

How this works is as follows:

  • Step 1: Make sure there are data points for all ticks from lastTick to currentTick
  • Step 2: Check if there are enough primary data points to create a consolidated data point.
  • Step 3: If so, apply the consolidation function
  • Step 4: Update the starting point in the archive definition
  • Step 5: Store the consolidated data point value in the archive.
writeArchiveHeader()
writeArchiveHeader($h, $archive)
writeArchiveRow()
writeArchiveRow($h, $tick, $values)
writeDataSource()
writeDataSource($h, $ds)