mlogtest#
Last updated: Nov 05, 2017
Generating log files for comparison testing#
Install required versions using
mand generateversions.jsonusingm installed --tojson >> versions.json.or
Create
versions.jsonwith required versions and paths.Generate logs using create_mongodb_logs.py. Adjust
commands.jsandmongod.confas required.For example:
python create_mongodb_logs.py --jscript commands.js -o logs.Run the
transferlogs.pyscript to copy full log, conf file, and snippet logs for each version.This script creates directories for each log version in the form:
v*/*/mongod.log.For example:
python transferlogs.py -i logs/ -o result/ ... result/v3.2/3.2.1/mongod-3.2.1.log result/v3.2/3.2.1/mongod-3.2.1.conf result/v3.2/3.2.1/MTEST-insert result/v3.2/3.2.1/MTEST-bulkinsert
Run
python transferlogs.py -hto see available options.
Diffing logs#
Run the
difflogs.pyscript to produce a report of differences between the specified log versions.The script treats the first argument as the base version, and outputs the lines in the second file that differ from the first.
For example:
python difflogs.py logs/v3.2/3.2.1/ logs/v3.4/3.4.10/
Run
python difflogs.py -hto see available options.