Stethoscope is a simple Python program that can be used for extracting and processing profiling information from the MonetDB server. The server can be instructed to emit two profiler events, in the form of JSON objects, for each instruction, one at the beginning and one at the end of its execution. Stethoscope can connect to the server and process the stream of profiling events for presentation to the user, either on stdout or in a user specified file. The user manual for stethoscope can be found here.

Stethoscope is essentially a pipeline with three distinct phases:

  • Reading and parsing
  • Processing
  • Formatting

Phase one (reading and parsing) happens automatically and the user has no control over it. Phase two (processing) is user configurable. There are a number of transformers that can be composed that change the JSON object in some way, usually by adding a key and a corresponding value. See here for a list and a description of the implemented trasformers. Phase three is also user configurable but consists in choosing one of the pre-defined formatters. These take a JSON object as input and present the information contained in it in some form. Usually this is for human consumption of the information. The list of the currently implemented formatters can be found here.

Finally, the user can choose the keys that will be contained in the JSON object that will be input to the formatter. This can be achieved in two ways, either by specifying the list of keys that should be kept, or by specifying the list of keys that should be dropped.