DataProvider Module

Scripting module to create data providers from scripted analyzes. Data providers are used to define what and how data will be exported, either as views or other means of exportation.

Example scripts with data providers can be found here:

Constants

Constant Description
ENTRY_DELTA Key for whether or not to display a value as a differential with previous value or use its absolute value.
ENTRY_DISPLAY Display key to create data providers
ENTRY_FIELD_PARENT_ID Parent ID key to create entries
ENTRY_FIELD_QUARK Quark key to create entries
ENTRY_ID Id key to create data providers
ENTRY_NAME Name key to create data providers
ENTRY_PARENT Parent key to create data providers
ENTRY_PATH Path key to create data providers

Method Overview

Method Description
createArrow() Create an arrow for a time graph data provider.
createEntry() Create a time graph entry.
createScriptedTimeGraphProvider() Create a data provider from scripted functions.
createTimeGraphProvider() Create a data driven time graph provider from one of the built-in analysis's state system.
createXYProvider() Create a data driven xy data provider from one of the built-in analyses.

Methods

createArrow

ITimeGraphArrow createArrow(long sourceId, long destinationId, long time, long duration, int value)

Create an arrow for a time graph data provider. This method will typically be used by scripts to create entries for data provider generated by the .createScriptedTimeGraphProvider(ScriptedAnalysis, Function, Function, Function) method.

sourceId
the ID of the source entry of the arrow
destinationId
The ID of the destination entry of the arrow
time
The start time of the arrow
duration
The duration of the arrow
value
The value to associate with this arrow

The new arrow

createEntry

ITmfTreeDataModel createEntry(String name, Map<String, Object> data)

Create a time graph entry. This method will typically be used by scripts to create entries for data provider generated by the .createScriptedTimeGraphProvider(ScriptedAnalysis, Function, Function, Function) method.

name
The name (label) of the entry
data
A map of fields to create the entry. Possible fields are .ENTRY_FIELD_QUARK (quark in the state system to use for the data. If not specified, it is expected the data provider will provide a method to retrieve the data), and .ENTRY_FIELD_PARENT_ID for the ID of the parent entry

A new entry model

createScriptedTimeGraphProvider

ITimeGraphDataProvider createScriptedTimeGraphProvider(ScriptedAnalysis analysis, java.util.function.Function<Map<String, Object>, List<ITimeGraphEntryModel>> entryMethod, Function rowModelMethod, Function arrowMethod)

Create a data provider from scripted functions. The script itself is responsible for generating the entries, optionally row data and arrows. For a simple state system, the .createTimeGraphProvider(ScriptedAnalysis, Map, String) may be used instead

analysis
The analysis this data provider is for
entryMethod
The function this data provider will use to get the entries. This parameter is mandatory.
rowModelMethod
The function this data provider will use to get the row data for time ranges. If none is specified, the entries are expected to have a quark indicating which row in the state system to use for the data.
arrowMethod
The function this data provider will use to get the arrow data for time ranges. If none is specified, no arrows will be drawn.

A time graph data provider

createTimeGraphProvider

ITimeGraphDataProvider createTimeGraphProvider(IAnalysisModule analysis, Map<String, Object> data, [String dpName])

Create a data driven time graph provider from one of the built-in analysis's state system. This will use the specified data to get the entries and row data from the state system. When the data cannot be obtained in a straight-forward manner from the state system, the .createScriptedTimeGraphProvider(ScriptedAnalysis, Function, Function, Function) method can be used instead.

The possible keys for the data are:

analysis
The analysis for which to create a time graph provider
data
The time graph provider data
dpName
The unique name of this data provider. If not set, the analysis name will be used. Output of this data provider will use this name as the titleOptional: defaults to <"">.

The time graph data provider

createXYProvider

ITmfTreeXYDataProvider createXYProvider(IAnalysisModule analysis, Map<String, Object> data, [String dpName])

Create a data driven xy data provider from one of the built-in analyses. This will use the specified data to get the entries from the state system. .ENTRY_PATH: MANDATORY, specifies the path in the state system (including wildcards) that is the root of the entries. For all root attributes, use '*' .ENTRY_DISPLAY: The path from the entry's root of the attribute to display. If not specified, the root attribute itself will be used .ENTRY_NAME: The path from the entry's root of the attribute that contains the name. If not specified, the name will be the attribute's name. .ENTRY_ID: The path from the entry's root of the attribute that contains an identifier for this entry. The identifier can be used to build hierarchies of entries using the .ENTRY_PARENT. .ENTRY_PARENT: The path from the entry's root of the attribute that contains the parent's ID. This data will be used along with the .ENTRY_ID to create a hierarchy between the entries. .ENTRY_DELTA: Specify the entry type. If it’s true, it will display the delta value of the entry otherwise it will show the absolute value of the entry.

analysis
The analysis for which to create a time graph provider
data
The XY chart data
dpName
The unique name of this data provider. If not set, the analysis name will be used. Output of this data provider will use this name as the titleOptional: defaults to <"">.

The XY data provider