Configuring Trend-Data Caching
By default, dashboard servers (data servers and display servers) collect trend data for all numeric output variables of DataViews running in their associated correlators. This data is cached in preparation for the possibility that it will be displayed as historical data in a trend chart when a dashboard starts up. Without the cache, trend charts would initially be empty, with new data points displaying as time elapses.
Advanced users can override the default caching behavior on a given server, and control caching in order to reduce memory consumption on that server, or in order to cache variables that are not cached by default, such as non-numeric variables.
Important:
In many cases, Server performance can be improved by overriding the default caching behavior, and suppressing the caching of those output variables for which trend-chart historical data is not required.
Caching trend data for string variables is very costly in terms of memory consumption.
You control caching with a trend configuration file, which allows you to specify the following:
Individual variables to cache
Classes of variables to cache
Default caching rules
Trend depths (number of data points to maintain) for each DataView
You do not need to provide a trend configuration file. If you provide no trend configuration file, dashboard servers use the default caching behavior described above.
Trend charts can include variables whose trend data is not cached, but they will display no historical (pre-dashboard-startup) data for those variables.
When a data server or display server starts, it uses the trend configuration file specified with the -G option, if supplied. Otherwise it uses the file trend.xml in the dashboards directory of your Apama work directory, if there is one. (Note that Apama provides an example trend configuration file, APAMA_HOME\etc\dashboard_onDemandTrend.xml, that you can copy to APAMA_WORK\dashboards\trend.xml as a basis for a trend configuration file.) Otherwise, it uses the default caching behavior described above.
Here is a sample configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<trend>
<item type="DATAVIEW" correlator="*" name="*"
vars="ALL_NUMERIC_OUTPUT" depth="10000"/>
<item type="DATAVIEW" correlator="*" name="DV_scenario1"
vars="LIST" depth="5000">
<var name="A"/>
<var name="B"/>
</item>
<item type="DATAVIEW" correlator="production" name="DV_dataview1"
vars="LIST" depth="5000">
<var name="A"/>
<var name="B"/>
</item>
</trend>
</config>
This file specifies the following:
For
DV_scenario1 in all correlators, cache trend data for variables
A and
B with a maximum trend depth of 5000.
For all other queries, cache all numeric output variables with a maximum trend depth of 10,000.
For
DV_dataview1 in correlator
production, cache variables
A and
B with a maximum trend depth of 5000.
For all other DataViews, cache no trend data.
In general, a trend configuration file is an XML file that includes of one or more item elements with the following attributes:
type:
DATAVIEW correlator: Logical name of correlator. Use
* for if the item applies to all correlators
name: DataView ID. Use
* if the item applies to all DataViews.
vars: Class of variables to cache trend data for. Specify one of the following:
LIST: Cache the individual variables that are listed in
var sub-elements.
ALL: Cache all input and output variables.
ALL_OUTPUT: Cache all output variables.
ALL_NUMERIC_OUTPUT: Cache all numeric output variables.
depth: Maximum depth of trend data to cache.
If the vars attribute of an item element is LIST, the element has zero or more var sub-elements. Each var element has single attribute, name, which specifies the name of a DataView field.
The item elements are nested in a trend element, which is nested within a config element.
If a particular DataView on a given correlator matches multiple item elements in a server's trend configuration file, the server chooses the best-matchingitem and caches the variables specified in that item. Following are the ways, in order from best to worst, in which an item can match a DataView on a given correlator:
1. Fully resolved: Exact match for both correlator name and DataView name
2. Wildcard correlator: Wildcard correlator and exact match for DataView name
3. Wildcard DataView: Exact match for correlator name and wildcard DataView
4. Fully wildcarded: Wildcard correlator and wildcard DataView
If there are multiple best matches, the last match is used.
Consider, for example, scenarios named DV_scenario1 and DV_scenario2, correlators named production and development, and the following item elements:
1 <item type="DATAVIEW" correlator="production" name="DV_scenario1"
vars="LIST" depth="5000">
2 <item type="DATAVIEW" correlator="*" name="DV_scenario1" vars="LIST"
depth="5000">
3 <item type="DATAVIEW" correlator="production" name="*" vars="LIST"
depth="5000">
4 <item type="DATAVIEW" correlator="*" name="*" vars="LIST"
depth="5000">
DV_scenario1 running on production best matches item1.
DV_scenario1 on development best matches item2.
DV_scenario2 on production best matches item3.
DV_scenario2 on development best matches item4.
Below are some additional sample configuration files. The following file caches trend data for all input and output variables:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<trend>
<item type="DATAVIEW" correlator="*" name="*" vars="ALL"
depth="10000"/>
</trend>
</config>
The following caches trend data for all numeric output variables, the default behavior:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<trend>
<item type="DATAVIEW" correlator="*" name="*"
vars="ALL_NUMERIC_OUTPUT" depth="10000"/>
<item type="DATAVIEW" correlator="*" name="*"
vars="ALL_NUMERIC_OUTPUT" depth="10000"/>
</trend>
</config>
The following caches no data, which results in trend-data collection only on demand:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<trend>
</trend>
</config>
The following caches a single variable for a single scenario:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<trend>
<item type="DATAVIEW" correlator="*" name="DV_scenario1"
vars="LIST" depth="5000">
<var name="PRICE"/>
</item>
</trend>
</config>