one of the problems that caused the memory leak, was an unhandled exception when converting events to JSON
while the event that failed conversion, was probably only partial -- factoring out the event create into event_create-builder functions, will enforce that only valid events are created.
This patch is the 2nd in a series to format in JSON all events collected by dshub/mshub event collector. It will create valid events via create_event builder function, the only source (@ time == 0) to create such events, and format the to JSON. The JSON output itself is not checked, only that converting to JSON does not throw an exception.
Remaining events will be transformed with a follow up patch
./build-x86/build/dsstests -t WebserviceTest/test_dshub_tojson -l warning
./build-x86/build/dsstests -t WebserviceTest/test_mshub_tojson -l warning