Logging server from ReFlex Framework and measurement data sets.
The repository contains the source code for the logging server. Additionally, the following data sets are included:
- app usage during public demonstration of the Elastic Display (LNdW 2025)
- measurements for depth accuracy of Azure Kinect sensor (stored point clouds from different time stamps)
- performance measurements for ReFlex Framework (memory consumption and CPU load) when using server and emulator for testing applications
| Directory | Content |
|---|---|
common |
Logging Server: data structures and route config |
data |
Logging Server: working directory for logging |
dist |
Logging Server: build output |
lndw |
App usage dataset |
measurements |
depth accuracy measurement data |
memoryProfiling |
perfomance measurements data |
routes |
LoggingServer: server routes |
scripts |
LoggingServer: Startup / automation scripts |
util |
LoggingServer: utilities |
- data directories are structured as follows:
| Directory | Content |
|---|---|
code |
Jupyter notebooks for data processing and generating plots |
data |
raw and processed data |
export |
plots (partially omitted due to file size limitations) |
- start logging / data service with
npm run debug(when debugging is necessary) ornpm run start - server runs at
http://localhost:4302 - Test request can be found in
test/Insomnia/Insomnia_Workspace.jsonfor testing the REST_API with Insomnia
- PerformanceLogger (
dist/performance-logger.js) subscribes toSignalRHubperfHubofReFlex.TrackingServerand fetches all diagnostics measurements from there. - KNOWN ISSUE: Reconnecting to the SignalR Hub does not work after restart of TrackingServer as connectionId changes and will not be reassociated when reconnecting. Therefore the process exits after a failed connection attempt
- PerfromanceMeasurement is automatically enabled in
ReFlex TrackingServerby periodically checking/api/Settings/MeasurePerformance - if MeasurePerfromance is not active a POST request to
/api/Settings/MeasurePerformancecontaining the json body{ name: 'MeasurePerformance', value: true }enables PerfromanceMeasuring - PerfromanceLogger also writes header for
appDatalog (if not already existing)
| endpoint | Method | Description | Example Request Body | Example Response Body |
|---|---|---|---|---|
/log/create |
POST | create log file / start logging | { "message": "FrameId, IsValid, Comment;" } |
{ "file": "2023-07-27T205105.042Z" } |
/log/data |
POST | log message to file {Date}_data.csv | { "message": "2, false, +++;" } |
|
/log/appData |
POST | log message to file {Date}_appData.csv | { "message": "2, false, +++;" } |
|
/log/data/2023-07-27T205105.042Z |
GET | retireve data logs | FrameId, IsValid, Comment;2, false, +++; |
|
/log/result |
POST | log result to file | { "ProbandId": 3, "test": true, "result": "result" } |
|
/log/result |
GET | retrieve results | { "ProbandId": 3, "test": true, "result": "result" } |
|
/data/11 |
POST | create data file data_011.json |
{ "data0": "test" "data1": "abc" "data3": "123"} |
{ "file": "data/data_011.json" } |
/data/11 |
GET | retrieve data file data_011.json |
{ "data0": "test" "data1": "abc" "data3": "123"} |
|
/data |
GET | list of available data sets | [ 11 ] |
- first create Log file with a POST-Request to
/log/create - as body, provide the header as message:
{ "message": "FrameId, IsValid, Comment;" }writes"FrameId, IsValid, Comment;in the first line of the data.csv The response contains the current log file name, in the form{ "file": "2023-07-27T204421.294Z" }This can be used for querying data logs (see Query Logs). - sensor data can be written in the same way by sending a POST request to
log/datawith the same body format ({ "message": "1, true, testresult;" }writes1, true, testresult;as line in the csv) - results are written by sending a json string to
/log/result. The body of the POST request is written as line in the result file without unmodified. - logs are stored in
/data/login the format%DATE%_data.csvfor tracking data and%DATE%_result.jsonfor results. - errors are logged in the same directory as
%DATE%_error.log
- Result sets can be retrieved by executing a GET request to
/log/result - Data Logs can be retrieved by executing a get request to
log/data/{file}, where file is the file name returned by/log/create
When generating data, these can be stored and retrieved in the data directory:
- save a data set in json format by sending a request to
/data/{id}withidbeing the identifier for the data set. - the json data provided in the body of the POST request is stored as
data_{id}in thedatadirectory - to retrieve this data set, just send a GET request to
/data/{id}
- in the folder
/scriptsare two scripts (bash for unix/linux/mac, PowerShell for Windows) executing the npm run script for starting both LogginServer and PerformanceLogger using the node process manager pm2 - the scripts contain the initial install of pm2 as comment, because this usually needs elevated permission, so better install pm2 manually beforehand using
npm install pm2@latest -g pm2automatically restarts the processes after they exited- to stop restarting the processes, execute
pm2 stop allon bash/concole/powershell andpm2 delete allto remove the processes from the process list. - the
pm2 daemoncan be closed usingpm2 kill(which also stops all running processes)