Skip to content

Add support for saving data to multiple sinks

Karol Krizka requested to merge combsink into devel

Adds a new class called CombinedSink that saves data to multiple sinks. This is done by forwarding all of the necessary calls to instances of given sinks.

This stream also adds a concept of a data stream. A data stream is a combination of IDataSinks targeting a specific set of data. They are defined in a new block called datastreams and returned by EquipConf::getDataStream as a CombinedSink. A monitoring application should use data streams for saving data as they are much more flexible than individual sinks. They allow saving data to multiple and varied combinations of destinations.

The ps_monitor and datasink_example tools have been update to use stream definitions instead of sinks.

An example configuration file looks like this:

{
    "datasinks":{
	"Console":{
            "sinktype": "ConsoleSink"
        },
	"File":{
            "sinktype": "CSVSink",
            "directory": "myOutputData"
        },
	"db": {
            "sinktype": "InfluxDBSink",
            "host": "127.0.0.1",
            "port": 8086,
            "database": "dcsDB",
            "username": "userName",
            "password": "password",
	    "precision": 5
        }
    },
    "datastreams":{
	"PowerSupplies":{
	    "sinks": ["Console", "db"]
	},
	"Climate":{
	    "sinks": ["Console"]
	},
    }
}
Edited by Karol Krizka

Merge request reports