Modules

API

Connection

Filtering

Tools useful for filtering JSON objects based on keys.

monetdb_stethoscope.filtering.exclude_filter(excluded_keys)

Returns a filter that discards the keys in excluded_keys list.

monetdb_stethoscope.filtering.filter_keys_exclude(json_object, excluded_keys)

Create a new dictionary by filtering a single given dictionary excluding the keys specified in the iterable excluded_keys.

monetdb_stethoscope.filtering.filter_keys_include(json_object, included_keys)

Create a new dictionary object by filtering a single given dictionary object including the keys specified in the iterable included_keys.

monetdb_stethoscope.filtering.identity_filter()

Returns a filter that does nothing.

monetdb_stethoscope.filtering.include_filter(included_keys)

Returns a filter that only keeps the keys in included_keys list.

Formatting

Utilities for formatting and outputting records.

monetdb_stethoscope.formatting.json_formatter(dct)

Creates a JSON string from the given dictionary (dct) and prints it to the given output_stream.

monetdb_stethoscope.formatting.line_formatter(dct)

Formats a dictionary dct into one line and prints it to the output_stream.

Values in dct are written one after the other, separated by the string ‘,t’. The whole line is surrounded by square brackets.

monetdb_stethoscope.formatting.raw_formatter(obj)

Prints the argument obj argument to the output_stream without further formatting.

Parsing

Tools used for parsing the MonetDB profiler output

monetdb_stethoscope.parsing.json_parser()

Returns a callable that can parse JSON strings.

monetdb_stethoscope.parsing.parser_wrapper(json_str)

JSON parser with exception logging

Transformers

Tools for changing (adding information) the profiler objects.

class monetdb_stethoscope.transformers.PrerequisiteTransformer

Add a list of PCs of prerequisite instructions.

class monetdb_stethoscope.transformers.ValueObfuscateTransformer

Replace every literal value in the plan with three asterisks.

monetdb_stethoscope.transformers.statement_constructor(json_object)

Reconstruct a MAL statement from the given profiler object.

Utilities

monetdb_stethoscope.utilities.identity_function(input_object)

Returns the argument as is.