本文整理了Java中java.util.concurrent.ForkJoinPool.getQueuedSubmissionCount()
方法的一些代码示例,展示了ForkJoinPool.getQueuedSubmissionCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ForkJoinPool.getQueuedSubmissionCount()
方法的具体详情如下:
包路径:java.util.concurrent.ForkJoinPool
类名称:ForkJoinPool
方法名:getQueuedSubmissionCount
[英]Returns an estimate of the number of tasks submitted to this pool that have not yet begun executing. This method may take time proportional to the number of submissions.
[中]返回提交到此池但尚未开始执行的任务数的估计值。此方法可能需要与提交数量成比例的时间。
代码示例来源:origin: ben-manes/caffeine
private void status() {
int drainStatus;
int pendingWrites;
local.evictionLock.lock();
try {
pendingWrites = local.writeBuffer().size();
drainStatus = local.drainStatus();
} finally {
local.evictionLock.unlock();
}
LocalTime elapsedTime = LocalTime.ofSecondOfDay(stopwatch.elapsed(TimeUnit.SECONDS));
System.out.printf("---------- %s ----------%n", elapsedTime);
System.out.printf("Pending reads: %,d; writes: %,d%n", local.readBuffer.size(), pendingWrites);
System.out.printf("Drain status = %s (%s)%n", STATUS[drainStatus], drainStatus);
System.out.printf("Evictions = %,d%n", cache.stats().evictionCount());
System.out.printf("Size = %,d (max: %,d)%n", local.data.mappingCount(), operation.maxEntries);
System.out.printf("Lock = [%s%n", StringUtils.substringAfter(
local.evictionLock.toString(), "["));
System.out.printf("Pending tasks = %,d%n",
ForkJoinPool.commonPool().getQueuedSubmissionCount());
long maxMemory = Runtime.getRuntime().maxMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
long allocatedMemory = Runtime.getRuntime().totalMemory();
System.out.printf("Max Memory = %,d bytes%n", maxMemory);
System.out.printf("Free Memory = %,d bytes%n", freeMemory);
System.out.printf("Allocated Memory = %,d bytes%n", allocatedMemory);
System.out.println();
}
代码示例来源:origin: co.paralleluniverse/quasar-core
@Override
protected int getQueueLength() {
return fjPool.getQueuedSubmissionCount();
}
代码示例来源:origin: co.paralleluniverse/quasar-core
@Override
public Integer getValue() {
return fjPool().getQueuedSubmissionCount();
}
});
代码示例来源:origin: co.paralleluniverse/quasar-core
@Override
public int getQueuedSubmissionCount() {
return fjPool().getQueuedSubmissionCount();
}
代码示例来源:origin: coffeewar/enode-master
@Override
public int getQueuedSubmissionCount() {
return java.util.concurrent.ForkJoinPool.commonPool().getQueuedSubmissionCount();
}
代码示例来源:origin: pravega/pravega
/**
* Gets a snapshot of the given ExecutorService.
*
* @param service The ExecutorService to request a snapshot on.
* @return A Snapshot of the given ExecutorService, or null if not supported.
*/
public static Snapshot getSnapshot(ExecutorService service) {
Preconditions.checkNotNull(service, "service");
if (service instanceof ThreadPoolExecutor) {
val tpe = (ThreadPoolExecutor) service;
return new Snapshot(tpe.getQueue().size(), tpe.getActiveCount(), tpe.getPoolSize());
} else if (service instanceof ForkJoinPool) {
val fjp = (ForkJoinPool) service;
return new Snapshot(fjp.getQueuedSubmissionCount(), fjp.getActiveThreadCount(), fjp.getPoolSize());
} else {
return null;
}
}
代码示例来源:origin: org.apidesign.bck2brwsr/emul
long st = getStealCount();
long qt = getQueuedTaskCount();
long qs = getQueuedSubmissionCount();
int pc = parallelism;
long c = ctl;
代码示例来源:origin: jtulach/bck2brwsr
long st = getStealCount();
long qt = getQueuedTaskCount();
long qs = getQueuedSubmissionCount();
int pc = parallelism;
long c = ctl;
代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166
long st = getStealCount();
long qt = getQueuedTaskCount();
long qs = getQueuedSubmissionCount();
int pc = parallelism;
long c = ctl;
代码示例来源:origin: com.arpnetworking.metrics.extras/jvm-extra
prefix,
"queued_submissions"),
executorService.getQueuedSubmissionCount());
metrics.setGauge(
String.join(
代码示例来源:origin: co.paralleluniverse/quasar-core
@Override
public ForkJoinInfo getInfo() {
final ForkJoinPool fjPool = fjPool();
int activeThreadCount = fjPool.getActiveThreadCount(); // Returns an estimate of the number of threads that are currently stealing or executing tasks.
int runningThreadCount = fjPool.getRunningThreadCount(); // Returns an estimate of the number of worker threads that are not blocked waiting to join tasks or for other managed synchronization.
int queuedSumbmissionCount = fjPool.getQueuedSubmissionCount(); // Returns an estimate of the number of tasks submitted to this pool that have not yet begun executing.
long queuedTaskCount = fjPool.getQueuedTaskCount(); // Returns an estimate of the total number of tasks currently held in queues by worker threads (but not including tasks submitted to the pool that have not begun executing).
long stealCount = fjPool.getStealCount(); // Returns an estimate of the total number of tasks stolen from one thread's work queue by another.
return new ForkJoinInfo(activeThreadCount, runningThreadCount, queuedSumbmissionCount, queuedTaskCount, stealCount);
}
代码示例来源:origin: stackoverflow.com
" poolSize=" + pool.getPoolSize() +
" queuedTasks=" + pool.getQueuedTaskCount() +
" queuedSubmissions=" + pool.getQueuedSubmissionCount() +
" parallelism=" + pool.getParallelism() +
" stealCount=" + pool.getStealCount());
代码示例来源:origin: vmware/xenon
createTimeSeriesStat(
ServiceHostManagementService.STAT_NAME_EXECUTOR_QUEUE_DEPTH,
executor.getQueuedSubmissionCount());
内容来源于网络,如有侵权,请联系作者删除!