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) { |