Information of Vera's Internship Summer 2015

From MonetDB
Jump to: navigation, search

A summary of Vera's Internship work in Summer2015

Schema definitions and Privileges[edit]

Coverage tool for MonetDB code[edit]

Steps to install the coverage tool (Sjoerd has got it working).

  • The gcov and lcov packages should be installed.
  • To run the coverage tool, execute the folowing two commands, before compilation:
   export CFLAGS="-fprofile-arcs -ftest-coverage"
   export LIBS="-lgcov"
  • After compilation there is a .gcno files generated for every .c file (do a search to make sure it worked the first time).
  • Then run the attached script giving as an option the same option you would give to Mtest.py (i.e. the desired tests). Running the tests will produce a .gcda file for each .c file that was executed (if there is a corresponding .gcno file).
  • Sometimes there is no .gcda output, although a test that executed the corresponding .c file was ran. Then that means you need to set the variables: GCOV_PREFIX and GCOV_PREFIX_STRIP.
  • For more information see: https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html and http://stackoverflow.com/a/28722897
  • The output will be in .../MonetDB/coverage-output/index.html.

Script to run the coverage tool ("runCoverage.sh"):

   #!/bin/bash
   args=("$@")
   
   # All the .gcda files need to be removed. Else it may not generate new ones.
   find . -name "*.gcda" -type f -delete
   
   # Call the tests you want.
   Mtest.py -r ${args[0]}
   
   # This file depends of a file that cannot be generated. 
   # XXX: Could be fixable, if it is possible to give flags to the yacc compile.
   rm BUILD/sql/server/.libs/libsqlserver_la-sql_parser.tab.gcda
   
   lcov --capture --directory ./BUILD --output-file coverage.info 
   genhtml coverage.info --output-directory coverage-output

Performance Tests[edit]

  • Studied CodeSpeed, which is a tool for performance testing written in Django/Python. It is a nice tool, but decided to not use it, because it has not been maintained for >2 years, while Django is a new language, which is being changed frequently.
  • Studied Jenkins: the plugins for testing used by other projects are too simple to be directly adopted for MonetDB. One of the drawbacks is that they only provide one history at a time.
  • Current results: using Python scripts to compile&install MonetDB, and run (benchmark) queries. Timing results are written in CSV files, one for data loading, one for queries. The CSV files can be read in by the GUI built in JavaScript to produce an interactive graph of the performance results.
 |MonetDB| --> |Python scripts| --> |times in CSV files| --> |GUI|
  • Ptest.py: the general script to run performance tests. Code is basically self-explanary.
  • run_tpch.py: calls Ptest.py, to run TPC-H benchmark in particular.
  • GUI uses 3 JS libs:
    • angular
    • dygraph: for the graph
    • papaparse: a JS parser for CSV files
  • KNOWN PROBLEM: graph drawing doesn't work on Safari. Basically, it's only tested using Firefox.
  • A repo will be created to trace the source code Vera has delivered.