You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/trace-server/trace-server-dev-guide.md
+240-5Lines changed: 240 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,10 @@ An `analysis` module in Trace Compass is an entity that consumes trace events of
13
13
14
14
A `configuration` is the data structure to configure and customize the trace server back-end globaly (e.g. load XML analysis) or to configure data providers with parameters.
15
15
16
+
### Configuration source
17
+
18
+
A configuration source is a source of configurations. It is responsible to manage global configurations (e.g. create, delete, update etc).
19
+
16
20
### Configuration source type
17
21
18
22
A configuration source type descibes the input parameters to provide when to pass when creating a new data provider or to configure the trace server globally.
@@ -225,7 +229,240 @@ A trace type defines a parser for the raw trace file(s). It will parse the raw t
225
229
226
230
## Component interactions
227
231
228
-
Trace compass provides a mechanism for different components to interact with each other using signals. The signals can carry information that is specific to each signal. In the Trace Server only uses a subset of the available signals, where `TmfTraceOpenedSignal` and `TmfTraceClosedSignal` are the most important signals. See the [Trace Compass Developer Guide for Eclipse](https://archive.eclipse.org/tracecompass/doc/nightly/org.eclipse.tracecompass.doc.dev/Component-Interaction.html#Component_Interaction) for more information about signals and how to send and receive them.
232
+
Trace compass provides a mechanism for different components to interact with each other using signals. The signals can carry information that is specific to each signal. In the Trace Server only uses a subset of the available signals, where `TmfTraceOpenedSignal` and `TmfTraceClosedSignal` are the most important signals, some other signals are not applicable when running in the trace server context. See the [Trace Compass Developer Guide for Eclipse](https://archive.eclipse.org/tracecompass/doc/nightly/org.eclipse.tracecompass.doc.dev/Component-Interaction.html#Component_Interaction) for more information about signals and how to send and receive them.
233
+
234
+
## Implementing a global configuration
235
+
236
+
Global configurations are used to load configuration parameters that configures the trace server application. For example, one can load XML analysis defintions using the global configuartion interface.
237
+
238
+
### Implementing a configuration source
239
+
240
+
To implement a configuration source use the extension point for configuration source with id `org.eclipse.tracecompass.tmf.core.config`. The following example explains for the XML anlaysis available in the Trace Compass core code base.
Return the configuration source type that this configuration source can handle. The configuration source type descibes the input parameter to pass when creating a global configuration. See chapter [Implementing a configuration source type](#implementing-a-configuration-source-type) about the class to return.
This method is called to create a global configuration base on the input configuration. It returns a `ITmfConfiguration` instance. It is repsonsible to persist the configuration in memory and on disk so that it is available after a server restart. To persist to disk the plug-in state location of workspace can be used which is accessible using Eclipse platform APIs.
This method is called to update an existing configuration with new parameters.
261
+
-`ITmfConfiguration remove(String id)`
262
+
This method is called to remove an existing configuration by ID. If the configuration exisits, this method is responsible to clean-up the peristed data. If, for example, analysis modules with state systems or other persisted data were created as result of an configuration, this method needs to make sure that those are clean-up.
263
+
-`List<ITmfConfiguration> getConfigurations()`
264
+
Gets all configuration instances.
265
+
-`boolean contains(String id)`
266
+
Method to check if a configuration with given ID exists
267
+
-`ITmfConfiguration get(String id)`
268
+
Returns a configuration with given ID if it exists
269
+
-`void dispose()`
270
+
Disposes the configuration source
271
+
272
+
The below the code for the `XmlConfigurationSource`. Note it reuses utilities that already existed for the integration with Eclipse Trace Compass.
Return one or more configuration source type that this configurator can handle. The configuration source type descibes the input parameter to pass when creating a data provider
1526
+
Return one or more configuration source type that this configurator can handle. The configuration source type describes the input parameter to pass when creating a data provider
This method is called to create derived data providers base on the input configuration. It returns a data provider descriptor of the derived data provider. The descriptor has to have the configuration set, has to have the capability of `canDelete` (so that it can be deleted) as well as it has to have an ID that has the configuration ID appended, which will be used by the corresponding data provider factory to create an instance of the data provider. It is repsonsible to create and manage analysis modules (e.g. add to ITmfTrace object) and persist the configuration in memory and disk so that it available after a server restart.
@@ -1308,7 +1545,7 @@ The actual data provider needs to apply the configuration. The easiest way is to
1308
1545
1309
1546
### Implementing a configuration source type
1310
1547
1311
-
The configuration source type descibes the input parameters to provide when to pass when creating a new data provider.
1548
+
The configuration source type descibes the input parameters to provide when to pass when creating a new data provider or global configuration.
1312
1549
1313
1550
The interface to implement is `ITmfConfigurationSourceType`. You can use the `TmfConfigurationSourceType.Builder` class to build such type. It has name, description, unique ID, an optional JSON schema file or a list of simple `TmfConfigurationParameter` instances. Use schema as much as you can. The schema will describe the JSON parameters, that `ITmfConfiguration.getParameters()` will return when passed to the configurator.
1314
1551
@@ -1325,7 +1562,6 @@ The interface to implement is `ITmfConfigurationSourceType`. You can use the `Tm
1325
1562
}
1326
1563
```
1327
1564
1328
-
1329
1565
### Implementing a configurable data provider without analysis module
1330
1566
1331
1567
To demonstrate how to implement a configurable data provider that doesn't use an analyis module, we will modify the data provider of chapter [Implementing data provider without analysis module](#implementing-a-data-provider-without-analysis-module). Please note that the class name and package names are different to be able to have independent examples in the example plug-in.
@@ -2906,7 +3142,6 @@ The interfaces for configurable data providers gives the developer the freedom t
2906
3142
2907
3143
## To Do
2908
3144
Provide guides for other features relevant for developing a custom trace server using Trace Compass core APIs, e.g.
0 commit comments