This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 269205
Collapse All | Expand All

(-)a/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemoteDirectory.java (-2 / +35 lines)
Lines 63-68 Link Here
63
import java.util.concurrent.Future;
63
import java.util.concurrent.Future;
64
import java.util.concurrent.TimeoutException;
64
import java.util.concurrent.TimeoutException;
65
import java.util.concurrent.atomic.AtomicInteger;
65
import java.util.concurrent.atomic.AtomicInteger;
66
import java.util.concurrent.atomic.AtomicLong;
66
import java.util.concurrent.locks.Lock;
67
import java.util.concurrent.locks.Lock;
67
import java.util.logging.Level;
68
import java.util.logging.Level;
68
import java.util.zip.ZipEntry;
69
import java.util.zip.ZipEntry;
Lines 521-533 Link Here
521
            setFlag(CONNECTION_ISSUES, true);
522
            setFlag(CONNECTION_ISSUES, true);
522
        } catch (IOException ex) {
523
        } catch (IOException ex) {
523
            RemoteLogger.info(ex, this); // undo won't show a red brick dialog, but print
524
            RemoteLogger.info(ex, this); // undo won't show a red brick dialog, but print
524
        }
525
        } 
525
        return new RemoteFileObject[0];
526
        return new RemoteFileObject[0];
526
    }
527
    }
527
528
528
    private DirectoryStorage getDirectoryStorage(String childName) throws
529
    private DirectoryStorage getDirectoryStorage(String childName) throws
529
            TimeoutException, ConnectException, IOException, InterruptedException, CancellationException, ExecutionException {
530
            TimeoutException, ConnectException, IOException, InterruptedException, CancellationException, ExecutionException {
530
        long time = System.currentTimeMillis();
531
        long time = System.currentTimeMillis();
532
        setFlag(MASK_INSIDE_GET_DIR_STORAGE, true);
531
        try {
533
        try {
532
            return getDirectoryStorageImpl(false, null, childName, false);
534
            return getDirectoryStorageImpl(false, null, childName, false);
533
        } catch (StackOverflowError soe) { // workaround for #130929
535
        } catch (StackOverflowError soe) { // workaround for #130929
Lines 535-542 Link Here
535
            Exceptions.printStackTrace(new Exception(text, soe));
537
            Exceptions.printStackTrace(new Exception(text, soe));
536
            throw new IOException(text, soe); // new IOException sic! this should never happen
538
            throw new IOException(text, soe); // new IOException sic! this should never happen
537
        } finally {
539
        } finally {
540
            setFlag(MASK_INSIDE_GET_DIR_STORAGE, false);
541
            time = System.currentTimeMillis() - time;
542
            reportTimeGDS(time);
538
            if (trace) {
543
            if (trace) {
539
                trace("getDirectoryStorage for {1} took {0} ms", this, System.currentTimeMillis() - time); // NOI18N
544
                trace("getDirectoryStorage for {1} took {0} ms", this, time); // NOI18N
540
            }
545
            }
541
        }
546
        }
542
    }
547
    }
Lines 1357-1362 Link Here
1357
            // we check "org.netbeans.modules.masterfs.watcher.disable" property to be on par with masterfs,
1362
            // we check "org.netbeans.modules.masterfs.watcher.disable" property to be on par with masterfs,
1358
            // which does the same and also sets this flag in tests 
1363
            // which does the same and also sets this flag in tests 
1359
            if (interceptor != null && !Boolean.getBoolean("org.netbeans.modules.masterfs.watcher.disable")) {
1364
            if (interceptor != null && !Boolean.getBoolean("org.netbeans.modules.masterfs.watcher.disable")) {
1365
                long time = System.currentTimeMillis();
1360
                try {
1366
                try {
1361
                    getFileSystem().setInsideVCS(true);
1367
                    getFileSystem().setInsideVCS(true);
1362
                    interceptor.refreshRecursively(FilesystemInterceptorProvider.toFileProxy(getOwnerFileObject()), 
1368
                    interceptor.refreshRecursively(FilesystemInterceptorProvider.toFileProxy(getOwnerFileObject()), 
Lines 1364-1375 Link Here
1364
1370
1365
                } finally {
1371
                } finally {
1366
                    getFileSystem().setInsideVCS(false);
1372
                    getFileSystem().setInsideVCS(false);
1373
                    time = System.currentTimeMillis() - time;
1374
                    reportTimeRR(time);
1367
                }
1375
                }
1368
            }
1376
            }
1369
            //fireFileChangedEvent(getListeners(), new FileEvent(this));
1377
            //fireFileChangedEvent(getListeners(), new FileEvent(this));
1370
        }
1378
        }
1371
        return storage;
1379
        return storage;
1372
    }
1380
    }
1381
    
1382
    private void reportTimeGDS(long time) {
1383
        if (time > 0 && RemoteLogger.isLoggable(Level.FINEST)) {
1384
            RemoteFileSystem fs = getFileSystem();
1385
            fs.dirStorageTime.addAndGet(time);
1386
            RemoteLogger.log(Level.FINEST,
1387
                    "#### GDS {0} {1} ms; Total GDS [{2}] {3} ms, including {4} in RR; total RR {5} ms", //NOI18N
1388
                    this.getPath(), time, getExecutionEnvironment(), fs.dirStorageTime, fs.dirStorageRR_VCSTime, fs.totalRR_VCSTime);
1389
        }        
1390
    }
1391
1392
    private void reportTimeRR(long time) {
1393
        if (time > 0 && RemoteLogger.isLoggable(Level.FINEST)) {
1394
            if (time > 0) {
1395
                RemoteFileSystem fs = getFileSystem();
1396
                if (getFlag(MASK_INSIDE_GET_DIR_STORAGE)) {
1397
                    fs.dirStorageRR_VCSTime.addAndGet(time);
1398
                }
1399
                fs.totalRR_VCSTime.addAndGet(time);
1400
                RemoteLogger.log(Level.FINEST,
1401
                        "#### RR {0} {1} ms; [{2}] Inside GDS: {3}; total RR {4} ms", //NOI18N
1402
                        this.getPath(), time, getExecutionEnvironment(), fs.dirStorageRR_VCSTime, fs.totalRR_VCSTime);
1403
            }
1404
        }
1405
    }
1373
1406
1374
    private void fireReadOnlyChangedEventsIfNeed(List<DirEntry> entriesToFireChangedRO) {
1407
    private void fireReadOnlyChangedEventsIfNeed(List<DirEntry> entriesToFireChangedRO) {
1375
        for (DirEntry entry : entriesToFireChangedRO) {
1408
        for (DirEntry entry : entriesToFireChangedRO) {
(-)a/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemoteFileObjectBase.java (+1 lines)
Lines 104-109 Link Here
104
    protected static final byte CONNECTION_ISSUES = 8;
104
    protected static final byte CONNECTION_ISSUES = 8;
105
    protected static final byte MASK_WARMUP = 16;
105
    protected static final byte MASK_WARMUP = 16;
106
    protected static final byte MASK_CYCLIC_LINK = 32;
106
    protected static final byte MASK_CYCLIC_LINK = 32;
107
    protected static final byte MASK_INSIDE_GET_DIR_STORAGE = 32;
107
108
108
    protected RemoteFileObjectBase(RemoteFileObject wrapper, RemoteFileSystem fileSystem, ExecutionEnvironment execEnv,
109
    protected RemoteFileObjectBase(RemoteFileObject wrapper, RemoteFileSystem fileSystem, ExecutionEnvironment execEnv,
109
            RemoteFileObjectBase parent, String remotePath) {
110
            RemoteFileObjectBase parent, String remotePath) {
(-)a/dlight.remote.impl/src/org/netbeans/modules/remote/impl/fs/RemoteFileSystem.java (+5 lines)
Lines 61-66 Link Here
61
import java.util.concurrent.ExecutionException;
61
import java.util.concurrent.ExecutionException;
62
import java.util.concurrent.atomic.AtomicBoolean;
62
import java.util.concurrent.atomic.AtomicBoolean;
63
import java.util.concurrent.atomic.AtomicInteger;
63
import java.util.concurrent.atomic.AtomicInteger;
64
import java.util.concurrent.atomic.AtomicLong;
64
import java.util.concurrent.locks.ReadWriteLock;
65
import java.util.concurrent.locks.ReadWriteLock;
65
import java.util.concurrent.locks.ReentrantReadWriteLock;
66
import java.util.concurrent.locks.ReentrantReadWriteLock;
66
import java.util.logging.Level;
67
import java.util.logging.Level;
Lines 148-153 Link Here
148
149
149
    private final RequestProcessor.Task connectionTask;
150
    private final RequestProcessor.Task connectionTask;
150
151
152
    /*package*/ final AtomicLong dirStorageTime = new AtomicLong(0);
153
    /*package*/ final AtomicLong dirStorageRR_VCSTime = new AtomicLong(0);
154
    /*package*/ final AtomicLong totalRR_VCSTime = new AtomicLong(0);
155
151
    /** 
156
    /** 
152
     * ConnectionTaskLock is now scheduled not only upon connection change, but from ctor as well
157
     * ConnectionTaskLock is now scheduled not only upon connection change, but from ctor as well
153
     * (in order to get auto mounts). 
158
     * (in order to get auto mounts). 

Return to bug 269205