benchmate.utils

benchmate.utils.general_utils

warn_for_status

def warn_for_status(response, message)

Check the status of a response and issue a warning if the status code is not 200. I should not be holding hands but i might as well

binary_data_transformer

def binary_data_transformer(data_bytes, binary_stream)

simpgle transformer that just writes the bytes to the stream, when in doubt use this for the compressed_stream_manager

Arguments:

  • data_bytes:
  • binary_stream:

compressed_stream_manager

@contextmanager
def compressed_stream_manager(obj: Any, transformer: Callable[[Any, io.IOBase],
                                                              None])

Arguments:

  • obj:
  • transformer:

decompressed_stream_manager

@contextmanager
def decompressed_stream_manager(compressed_bytes: bytes,
                                reconstructor: Callable[[BinaryIO], Any])

Generic manager to decompress bytes and yield the reconstructed object.

Arguments:

  • compressed_bytes: The raw gzipped bytes from the DB.
  • reconstructor: A function that takes a binary stream and returns an object.

This site uses Just the Docs, a documentation theme for Jekyll.