def _after_exec(self, conn, clause, multiparams, params, results):
        """ SQLAlchemy event hook """
        # calculate the query time
        end_time = time.time()
        start_time = getattr(conn, '_sqltap_query_start_time', end_time)

        # get the user's context
        context = (None if not self.user_context_fn
                   else self.user_context_fn(
                        conn, clause, multiparams, params, results))

        try:
            text = clause.compile(dialect=conn.engine.dialect)
        except __HOLE__:
            text = clause

        params_dict = self._extract_parameters_from_results(results)

        stack = traceback.extract_stack()[:-1]
        qstats = QueryStats(text, stack, start_time, end_time,
                            context, params_dict, results)

        self.collect_fn(qstats)
dataset/ETHPy150Open inconshreveable/sqltap/sqltap/sqltap.py/ProfilingSession._after_exec