kieker-monitoring / kieker

Kieker's main repository
Apache License 2.0
70 stars 41 forks source link

[KIEKER-1019] Allow cockpit reloading during running analysis (Missing IDs) #2791

Closed rju closed 1 week ago

rju commented 1 week ago

JIRA Issue: KIEKER-1019 Allow cockpit reloading during running analysis (Missing IDs) Original Reporter: Nils Christian Ehmke


It would be nice if one could modify the cockpit with the cockpit editor during a running analysis (i.e, add additional displays).

The current approach for the cockpit: When an analysis is instantiated, the webgui uses the mapping between the model instances and the actual plugin instances (keyword AnalysisControllerWithMapping) to "connect" the instances of MIDisplayConnector to actual methods of the running analysis. The said mapping is simply a Map<MIPlugin, AbstractPlugin> instance.

Now assume that someone adds another MIDisplayConnector of some MIPlugin with the editor to the model and reloads the cockpit. How could one get the corresponding AbstractPlugin instance from the running analysis? There are currently no IDs or something. The plugins have names, but they don't have to be unique.

So: Does anyone have an idea how to solve this? Otherwise I would suggest to add unique IDs to the model instances (or use the names for this purpose), which would also have to be used in the AnalysisController (I would need a method, which would deliver the plugin for a given ID).

(The ID issue has already been mentioned in KIEKER-614 Done , although I found another solution for that problem)

rju commented 1 week ago

author nils-christian -- Wed, 12 Jun 2013 13:04:10 +0200

Possible solution without IDs in the meta model:

The analysis remembers the mapping and uses the order of the plugins as ID (i.e., first plugin in the project has ID 0). This solution is not perfect, but would compensate the lack of IDs (also I use a similar technique to save the analysis and cockpit layout in the meta file).

rju commented 1 week ago

author Jan Waller -- Wed, 12 Jun 2013 17:38:07 +0200

Can't you use the objects as ids?

rju commented 1 week ago

author nils-christian -- Wed, 12 Jun 2013 17:42:29 +0200

Replying to [jwa|comment:2]:
> Can't you use the objects as ids?

Theoretically yes. But the cockpit reloads the kax file and uses therefore an own project model instance with own objects. The editors, for example, could not work without loading an own model. They have to work on a local copy, which can be modified at will.

rju commented 1 week ago

author Jan Waller -- Wed, 12 Jun 2013 17:59:43 +0200

And you can't include the objects as a mapping in this model?

rju commented 1 week ago

author nils-christian -- Wed, 12 Jun 2013 18:14:08 +0200

I am not sure that I know what you mean. After the analysis has been instantiated (in other words: The AnalysisController has been loaded from a KAX-File) I have a (bijective) mapping MIPlugin <-> AbstractPlugin. Neither of these classes have an ID. The only existing ID is the actual reference to the Java object.
If someone would use the cockpit editor to add more displays, they would load the KAX-File again. The cockpit editor would have an own model with other instances of MIPlugin. The mapping MIPlugin <-> AbstractPlugin would therefore be useless for the cockpit editor.

rju commented 1 week ago

author Jan Waller -- Mon, 17 Jun 2013 17:02:24 +0200

We will add ids to the MetaModel (EMF feature)

rju commented 1 week ago

author nils-christian -- Mon, 17 Jun 2013 21:26:50 +0200

I added some IDs to the meta model in a new branch (meta-model-IDs-KIEK-1019). The elements which got an ID are:
- MIAnalysisComponent
- MIPort
- MIRepositoryConnector
- MIDisplay
- MIView
- MIDisplayConnector

The IDs are added in the javaToMetaModel method of the MetaModelHandler using EcoreUtil.generateUUID().

There does not seem to be a problem with "old" KAX files. The AC can still load and use them. When the AC saves them, the IDs are replaced:

<plugins xsi:type="Reader" name="TimeReader" classname="kieker.analysis.plugin.reader.timer.TimeReader">
    <properties name="updateIntervalNS" value="1500000000"/>
    <properties name="delayNS" value="0"/>
    <properties name="blockingRead" value="true"/>
    <outputPorts name="timestamps" subscribers="//plugins.4/inputPorts.0"/>
    <outputPorts name="timestampRecords" subscribers="//plugins.3/inputPorts.0"/>
  </plugins>
 <plugins xsi:type="Reader" name="TimeReader" classname="kieker.analysis.plugin.reader.timer.TimeReader" id="_iJrBoNeCEeKNAZ_i1Xul-g">
    <properties name="updateIntervalNS" value="1500000000"/>
    <properties name="blockingRead" value="true"/>
    <properties name="delayNS" value="0"/>
    <outputPorts name="timestamps" id="_iJrBodeCEeKNAZ_i1Xul-g" subscribers="_iJrBsNeCEeKNAZ_i1Xul-g"/>
    <outputPorts name="timestampRecords" id="_iJrBoteCEeKNAZ_i1Xul-g" subscribers="_iJrBrNeCEeKNAZ_i1Xul-g"/>
  </plugins>

Anything I forgot?

rju commented 1 week ago

author Jan Waller -- Tue, 18 Jun 2013 10:06:50 +0200

seems fine to me (but I am no EMF expert)

rju commented 1 week ago

author nils-christian -- Tue, 18 Jun 2013 10:52:48 +0200

Merged in d3000d663e9737377bca336341da4f721516530c.