« Back to Product

Documentation

AC_GetAggregationVariables

Require: IP-Symcon >= 3.0

 array AC_GetAggregationVariables (int $InstanceID, boolean $DatabaseQuery) 

Parameters

InstanceID

ID for the archive

DatabaseQuery

True, if additional information is to be displayed, otherwise False (with version 4.0 and above unimportant, but required)

Returns

An array with the following key => value pairs.

Index Type Description
FirstTime integer Date/time from the beginning of the aggregation period as a Unix Timestamp
LastTime integer Date/time of the last entry of the aggregation period as a Unix Timestamp
RecordCount integer Number of records
RecordSize integer Size of all data records in bytes
VariableID integer ID of the variable
AggregationType integer Aggregation type as an Integer. See also AC_GetAggregationType
AggregationVisible boolean Indicates whether the variable is displayed in the visualization. See also AC_GetGraphStatus
AggregationActive boolean Indicates whether logging is active for this variable. See also AC_GetLoggingStatus

Description

Warning

With version 4.0 and above the specified parameter DatabaseQuery is no longer used. However, this must be specified for downward compatibility.

This function returns an array of all logged tags of the archive handler with the ID InstanceID. Additional information about each variable can be activated with DatabaseQuery. (Functional up to version 3.4)

Example

// Output with additional information
var_dump(AC_GetAggregationVariables(39147 /*[Archive]*/, true));
 
// Sample output:
array(1) {
  [0]=>
  array(8) {
    ["FirstTime"]=>
    int(1444221643)
    ["LastTime"]=>
    int(1444221705)
    ["RecordCount"]=>
    int(6)
    ["RecordSize"]=>
    int(78)
    ["VariableID"]=>
    int(53716)
    ["AggregationType"]=>
    int(0)
    ["AggregationVisible"]=>
    bool(true)
    ["AggregationActive"]=>
    bool(true)
  }
}
*/
Any questions?