private array $dataSources
private array $dataSourceTypes
private array $archiveCFs
public __construct({Array})
Parameter | Type | Description |
---|
$file | string | |
public __destruct({Array})
addDataSource('speed', 'COUNTER', 0, 600, 'Speed Counter');.
public addDataSource({Array})
Parameter | Type | Description |
---|
$dsname | string | //The name of the data source |
$type | string | //Data source types are: GAUGE, COUNTER, ABSOLUTE |
$min | int | //Minimum allowed value |
$max | int | //Maximum allowed value |
$description | string | //String describing the data source |
addArchive('day_average', 'AVERAGE', 60, 24);.
public addArchive({Array})
Parameter | Type | Description |
---|
$archiveID | string | Name of the archive |
$cf | string | Consolidation function and can be: AVERAGE, MIN, MAX or LAST |
$ticks | int | Number of ticks to consolidate into a row |
$rows | int | Number of rows to store in the archive |
$description | string | A string describing the archive |
Get a tick value.
Parameter | Type | Description |
---|
$time | int | Defaults to the current time if not specified |
Parameter | Type | Description |
---|
$tickSec | int | |
Parameter | Type | Description |
---|
$dsname | string | |
$value | float | |
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: Load all the available data points ready to be processed
- Step 2: Make sure there are data points for all ticks from lastTick to currentTick
- Step 3: Check if there are enough primary data points to create a consolidated data point.
- Step 4: If so, apply the consolidation function
- Step 5: Update the starting point in the archive definition
- Step 6: Store the consolidated data point value in the archive.
public hasDataSource({Array})
Parameter | Type | Description |
---|
$name | string | |
public getDataSources({Array})
public getArchives({Array})
Parameter | Type | Description |
---|
$dsname | string | |
$archiveID | string | |
$ | false | |
Retrieve the raw primary data points stored in a data source.
Parameter | Type | Description |
---|
$dsname | string | the name of the data source |
$ | false | |
Calculate the length of a row within an archive.
private getCDPLength({Array})
Calculate the start position in the file of a data source.
private getDataSourceOffset({Array})
Parameter | Type | Description |
---|
$dsname | NULL | The name of the data source. If omitted, returns the position of the byte after all data sources |
Calculate the start position in the file of an archive.
private getArchiveOffset({Array})
Parameter | Type | Description |
---|
$archiveID | string | The name of the archive |
Load data sources and archives from an existing RRD database file.
private restoreOptions({Array})
private writeDataSource({Array})
Parameter | Type | Description |
---|
$ds | array | |
private writeArchive({Array})
Parameter | Type | Description |
---|
$archive | array | |
private writeCDP({Array})
Parameter | Type | Description |
---|
$tick | int | |
$values | array | |
$doWrite | bool | |
private consolidate({Array})
Parameter | Type | Description |
---|
$cf | int | |
$dataPoints | array | |
$dsType | int | |
Generated by Hazaar API Doc Generator