Utilities for dealing with .cubex files¶
This module contains low-level functions that wrap/call the
cube_dump utility.
-
cube_file_utils.get_dump(profile_file, exclusive=True)¶ Parses output of
cube_dumpon a.cubexfile and returns a dataframe.Thin wrapper around
pandas.read_csv, to obtain pandas dataframes with all the metrics out of.cubexfiles viacube_dump. The layout of the dataframe is the same as the one coming out ofcube_dump.- Parameters
profile_file (str) – Name of the
.cubexfile.exclusive (bool) – Whether to ask
cube_dumpfor exclusive (True) or inclusive (False) metrics.
- Returns
res – A DataFrame containing all the metrics in the
.cubexfile.- Return type
pandas.DataFrame
-
cube_file_utils.get_cube_dump_w_text(profile_file)¶ Simple function that calls
cube_dump -wand gets the output as a string.- Parameters
profile_file (str) – Name of the
*.cubexfile.- Returns
cube_dump_w_text – Output of
cube_dump -w- Return type
str
-
cube_file_utils.get_lines(cube_dump_w_text, start_hint, end_hint)¶ Select a section of the output of ‘cube_dump -w’.
- Parameters
cube_dump_w_text (str) – Text containing the whole output of
cube_dump -wstart_hint (str) – String signalling the beginning of the section of interest.
end_hint (str) – String signalling the end of the section of interest.
- Returns
lines – List of all non-empty lines between start_hint and end_hint.
- Return type
list of str