def METHOD_NAME(session):
    start_time = transaction_start_map.get(session)
    if not start_time:
        return
    del transaction_start_map[session]
    t = time.time()
    latency = int((t - start_time) * 1000)
    if config.get("ENABLE_DB_TXN_METRICS", False):
        statsd_client.timing(metric_name, latency)
        statsd_client.incr(metric_name)
    if latency > MAX_SANE_TRX_TIME_MS:
        log.warning(
            "Long transaction",
            latency=latency,
            modname=modname,
            funcname=funcname,
        )