To allow for controlled experiments and evaluation of Aggie, we have developed a content service that will replay the reports found in a json file.
Reports will be "replayed" with the same cadence than in the original "recording". To set up and save a recording
- Start Aggie normally with the sources you want to record.
- Set fetching off when you want to finish your recording.
- Dump the sources
mongodump --db aggie --collection sources
as we need to use the same mongoDB's_id
. - Export the reports you want to replay to a json file for the time range you want e.g:
mongoexport --db aggie -c reports -q '{storedAt: { "$gt": {"$date" : "2016-11-14T03:54:26.130Z"}, "$lt": {"$date" : "2016-11-14T03:54:30.130Z"}}}' --sort '{storedAt: 1}' --sort '{storedAt: 1}' > reports.json
- Export the previous reports:
mongoexport --db aggie -c reports -q '{storedAt: { "$lte": {"$date" : "2016-11-14T03:54:26.130Z"}}}' --sort '{storedAt: 1}' > previous_reports.json
To play a recording:
- Set fetching off
- Stop Aggie.
- Drop sources, incidents, reports. Drop other collections if not needed in your experiment.
- Load previous reports if needed:
mongoimport --db aggie --collection reports --file previous_reports.json
- Set the experimental variables of
secrets.json
:experiment
totrue
and pointexperimentFile
variable to where the json file is, relative to the Aggie folder. - Restore the sources dump to the database:
mongorestore --db aggie --collection sources dump/aggie/sources.bson
- Start Aggie.
- Set fetching on.
- We are now replaying
reports.json
.