New datasink class CSVSink
This is a follow-up on MR 102 and MR 104.
A new sink class is added CSVSink
. Instead of printing the measurement to the console, the measurement is printed to a CSV file.
The example is run as ./build/bin/ps_monitor src/config/input-hw.json File low-voltage
The format in the output file similar to that of ConsoleSink
except the tags are columns and the first column is empty. The file is saved as powersupply.csv
, where powersupply
is the name of the measurement.
time,Channel,Voltage,Current
1595909424445, low-voltage,0.000434768,0.000304329
1595909424633, low-voltage,0.000582471,0.000284497
1595909424809, low-voltage,0.000631706,0.000324161
The sink and the name for the output directory are specified in the configuration json:
"datasinks":{
"File":{
"sinktype": "CSVSink",
"directory": "./"
}
Edited by Elodie Deborah Resseguie