Skip to content

kallimachos/mlogtest

Repository files navigation

mlogtest

https://travis-ci.org/kallimachos/mlogtest.svg?branch=master https://img.shields.io/pypi/status/mlogtest.svg?style=flat https://img.shields.io/pypi/v/mlogtest.svg?style=flat https://img.shields.io/badge/Python-2.7-brightgreen.svg?style=flat https://img.shields.io/badge/Python-3.6-brightgreen.svg?style=flat http://img.shields.io/badge/license-GPL-blue.svg?style=flat

Generating log files for comparison testing

  1. Install required versions using m and generate versions.json using m installed --tojson >> versions.json.

    or

    Create versions.json with required versions and paths.

  2. Generate logs using create_mongodb_logs.py. Adjust commands.js and mongod.conf as required.

    For example:

    python create_mongodb_logs.py --jscript commands.js -o logs.

  3. Run the transferlogs.py script 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
    
  4. Run python transferlogs.py -h to see available options.

Diffing logs

  1. Run the difflogs.py script 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/

  2. Run python difflogs.py -h to see available options.