Generic RTR Writer
Overview
rtctkGenRtrWriter is a troubleshooting tool to write values to one or more configuration data points (DP)
and to the Run-Time Repository (RTR) in parallel.
It can be used to write values to verify if it works, check how long it takes to simply do the writing,
or for benchmarking purposes. E.g. how long does it take to write a value of a certain size or
write and later read (and apply) a value from the RTR.
Prerequisites
To be able to use the tool, the Run-Time Repository (RTR) needs to be running. As RTR is based on CII OLDB service, the service needs to be run and properly configured. If the tool is used for benchmarking of a distributed case, i.e. system running on several machines, then all machines need to be time synchronized using PTP or similar, so that timestamps can be compared.
Running
The generic RTR Writer is run by executing: rtctkGenRtrWriter with the proper command line arguments.
For a list of command line options, run the executable with option -h or --help.
E.g. run the writer that writes 200 times values in parallel to two data points (test/dynamic/dp_1 and test/dynamic/dp_2) of type RtcMatrixFloat (i.e. float matrix) to run-time repository cii.oldb:/runtime_repo, with 1.1 second delay between consecutive writes.
$ rtctkGenRtrWriter -d --type="RtcMatrixFloat" --period=1.1 --rtr=cii.oldb:/runtime_repo --dpi "test/dynamic/dp_1",3000,1 "test/dynamic/dp_2",5000,5000 -n 200
This produces output similar to:
Going to create RTR writer for DP:test/dynamic/dp_1 type:RtcMatrixFloat dimension:3000,1
[2024-03-06 08:05:52.453][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] DP does not exist going to create one.
[2024-03-06 08:05:52.466][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_1] Created matrix of size: 3000 x 1
Going to create RTR writer for DP:test/dynamic/dp_2 type:RtcMatrixFloat dimension:5000,5000
[2024-03-06 08:05:52.466][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_1] Going to write value of size: 3000 x 1 (12000 bytes) 200 times.
[2024-03-06 08:05:52.466][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] Going to write DP. Iteration: 0.
[2024-03-06 08:05:52.474][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] DP does not exist going to create one.
[2024-03-06 08:05:52.479][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] Wrote to DP at time (epoch): 1709712352.466901. Iteration: 0. Write time [us]: min: 12596 max: 12596 mean: 12596.00 variance: 0.00
[2024-03-06 08:05:52.624][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_2] Created matrix of size: 5000 x 5000
[2024-03-06 08:05:52.624][INFO ][rtctkGenRtrWriter] Initialising Done!
==> Ctrl-C to exit <=.
[2024-03-06 08:05:52.624][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_2] Going to write value of size: 5000 x 5000 (100000000 bytes) 200 times.
[2024-03-06 08:05:52.624][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Going to write DP. Iteration: 0.
[2024-03-06 08:05:53.494][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Wrote to DP at time (epoch): 1709712352.624631. Iteration: 0. Write time [us]: min: 869924 max: 869924 mean: 869924.00 variance: 0.00
[2024-03-06 08:07:43.156][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] Going to write DP. Iteration: 100.
[2024-03-06 08:07:43.162][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] Wrote to DP at time (epoch): 1709712463.156116. Iteration: 100. Write time [us]: min: 5175 max: 19945 mean: 6752.70 variance: 11162472.41
[2024-03-06 08:09:32.190][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Going to write DP. Iteration: 100.
[2024-03-06 08:09:33.457][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Wrote to DP at time (epoch): 1709712572.190800. Iteration: 100. Write time [us]: min: 1045383 max: 1266743 mean: 1099546.22 variance: 2122834815.99
[2024-03-06 08:09:33.887][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_1] 200 / 200 values have been written. DONE!
[2024-03-06 08:09:33.887][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] Write time [us]: min: 4844 max: 16225 med: 7238.08 variance: 13616657.63
[2024-03-06 08:13:13.462][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_2] 200 / 200 values have been written. DONE!
[2024-03-06 08:13:13.463][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Write time [us]: min: 1067424 max: 1241024 med: 1111083.54 variance: 2298588587.97
[2024-03-06 08:13:13.681][INFO ][rtctkGenRtrWriter] Exiting ...
[2024-03-06 08:13:13.681][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_1] Finalize
[2024-03-06 08:13:13.681][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_1] Going to delete DP.
[2024-03-06 08:13:13.687][INFO ][rtctkGenRtrWriter] [test/dynamic/dp_2] Finalize
[2024-03-06 08:13:13.687][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Going to delete DP.
[2024-03-06 08:13:14.167][INFO ][rtctkGenRtrWriter] Shutting down.
A useful information for benchmarking (besides the write time statistics themselves) is the timestamp (in epoch and as part of the log message) just before the write, which can be used to calculate the round-trip time of the configuration data point. I.e. messages:
[2024-03-06 08:05:52.624][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Going to write DP. Iteration: 0.
[2024-03-06 08:05:53.494][DEBUG][rtctkGenRtrWriter] [test/dynamic/dp_2] Wrote to DP at time (epoch): 1709712352.624631. Iteration: 0. Write time [us]: min: 869924 max: 869924 mean: 869924.00 variance: 0.00
Stopping
The process can be stopped either by using Ctrl-C or by waiting that the values have been written the specified number of times (option -n).