-
Notifications
You must be signed in to change notification settings - Fork 30
TDS debugging
Much like it is necessary to debug the inference process, occasionally it is necessary to populate the Transit Data Service with historical data to query the state of the system. Whereas inference debugging is concerned with one trace (one bus run), TDS debugging allows for the state of entire system to be considered.
A simple spring task has been created to accomplish this that replaces the queue listener. Instead of populating the TDS with queue data from the inference engine, it populate the TDS with the results of a JSON file. This JSON file can be generated by any means, but is fairly trivial to produce from the reporting and archive database.
(TODO: include link to script source here)
Here is what the resulting JSON is expected to look like:
{'status': 'default', 'distanceAlongBlock': None, 'tripId': None, 'vehicleId': 'ACTA_XXX', 'blockId': None, 'recordTimestamp': 1372455001000L, 'inferredLatitude': '40.652985', 'serviceDate': 0L, 'phase': 'DEADHEAD_BEFORE', 'inferredLongitude': '-73.999039'} {'status': 'default', 'distanceAlongBlock': 22472.939858083413, 'tripId': 'ACTA_1', 'vehicleId': 'ACTA_1234', 'blockId': 'ACTA_2', 'recordTimestamp': 1372455001000L, 'inferredLatitude': '40.858017', 'serviceDate': 1372392000000L, 'phase': 'DEADHEAD_DURING', 'inferredLongitude': '-73.826607'}
Currently this file is loaded upon context initialization, but it would be a fairly trivial change to split this off into a background thread and then respect the timestamps of the JSON data.
- obtain the bundle you wish to run and place it in /tmp/oba-bundle
- edit onebusaway-nyc-transit-data-federation-webapp/src/main/resources/data-sources.xml; comment out the inferenceInputQueue bean, and uncomment the fileInput bean, noting the expected location of the file
- ensure the JSON file is available at the above location
- build and deploy onebusaway-nyc-vehicle-tracking-webapp with the "local-ie-testing" profile
- build onebusway-nyc-webapp with the "local-ie-testing" profile
- set your system clock to a within a few minutes of the JSON data
- build and deploy onebusaway-nyc-acta-webapp with the "local-ie-testing,eclipse-only" profile
- interrogate the TDS and or the UIs to examine the results