def METHOD_NAME(self, connection: Connection, *, logger: "LoggerFunction" = logging.log):
    if not connection.is_connected():
        return True
    if self._heartbeats and getattr(connection, 'received_heartbeat') and connection.received_heartbeat:
        heartbeat_period_seconds = max(0, self._heartbeats[0], self._heartbeats[1]) / 1000
        if not heartbeat_period_seconds:
            return False
        now = monotonic()
        if connection.received_heartbeat + 10 * heartbeat_period_seconds < now:
            logger(logging.WARNING, "Stomp connection missed heartbeats for a long time")
            return True
    return False