本文整理了Java中java.util.concurrent.ScheduledThreadPoolExecutor.getActiveCount()
方法的一些代码示例,展示了ScheduledThreadPoolExecutor.getActiveCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScheduledThreadPoolExecutor.getActiveCount()
方法的具体详情如下:
包路径:java.util.concurrent.ScheduledThreadPoolExecutor
类名称:ScheduledThreadPoolExecutor
方法名:getActiveCount
暂无
代码示例来源:origin: spring-projects/spring-framework
/**
* Return the number of currently active threads.
* <p>Requires an underlying {@link ScheduledThreadPoolExecutor}.
* @see #getScheduledThreadPoolExecutor()
* @see java.util.concurrent.ScheduledThreadPoolExecutor#getActiveCount()
*/
public int getActiveCount() {
if (this.scheduledExecutor == null) {
// Not initialized yet: assume no active threads.
return 0;
}
return getScheduledThreadPoolExecutor().getActiveCount();
}
代码示例来源:origin: org.springframework/spring-context
/**
* Return the number of currently active threads.
* <p>Requires an underlying {@link ScheduledThreadPoolExecutor}.
* @see #getScheduledThreadPoolExecutor()
* @see java.util.concurrent.ScheduledThreadPoolExecutor#getActiveCount()
*/
public int getActiveCount() {
if (this.scheduledExecutor == null) {
// Not initialized yet: assume no active threads.
return 0;
}
return getScheduledThreadPoolExecutor().getActiveCount();
}
代码示例来源:origin: voldemort/voldemort
@JmxGetter(name = "numActiveTasks", description = "Returns number of tasks executing currently")
public long getActiveTasksCount() {
return this.scheduler.getActiveCount();
}
代码示例来源:origin: gravitee-io/gravitee-gateway
public int getActiveCount() {
return SubscriptionsServiceHandler.this.executorService.getActiveCount();
}
代码示例来源:origin: gravitee-io/gravitee-gateway
public int getActiveCount() {
return ApiKeysServiceHandler.this.executorService.getActiveCount();
}
代码示例来源:origin: i2p/i2p.i2p
private String debug() {
return
" Pool: " + _name +
" Active: " + _executor.getActiveCount() + '/' + _executor.getPoolSize() +
" Completed: " + _executor.getCompletedTaskCount() +
" Queued: " + _executor.getQueue().size();
}
}
代码示例来源:origin: i2p/i2p.i2p
/** warning - slow */
private String debug() {
_executor.purge(); // Remove cancelled tasks from the queue so we get a good queue size stat
return
" Pool: " + _name +
" Active: " + _executor.getActiveCount() + '/' + _executor.getPoolSize() +
" Completed: " + _executor.getCompletedTaskCount() +
" Queued: " + _executor.getQueue().size();
}
代码示例来源:origin: HubSpot/Singularity
private void reEnqueue() {
LOG.debug("Re-enqueueing request for {}, waiting {}, ({} active, {} queue, {} max), total time {}", artifactDownloadRequest.getTargetDirectory(),
JavaUtils.durationFromMillis(configuration.getMillisToWaitForReEnqueue()),
downloadJoinerService.getActiveCount(),
downloadJoinerService.getQueue().size(),
configuration.getNumEnqueueThreads(),
JavaUtils.duration(start));
downloadJoinerService.schedule(this, configuration.getMillisToWaitForReEnqueue(), TimeUnit.MILLISECONDS);
}
代码示例来源:origin: Comcast/cmb
@Override
public int getAsyncWorkerPoolActiveCount() {
return CMBControllerServlet.workerPool.getActiveCount();
}
代码示例来源:origin: io.gravitee.gateway.services/gravitee-gateway-services-apikeyscache
public int getActiveCount() {
return ApiKeysServiceHandler.this.executorService.getActiveCount();
}
代码示例来源:origin: org.rhq/rhq-core-plugin-container
public boolean isDiscoveryScanInProgress() {
return (this.inventoryThreadPoolExecutor.getActiveCount() >= 1);
}
代码示例来源:origin: io.gravitee.gateway.services/gravitee-gateway-services-subscriptions-cache
public int getActiveCount() {
return SubscriptionsServiceHandler.this.executorService.getActiveCount();
}
代码示例来源:origin: wildfly/wildfly-core
public int getActiveCount() {
return executor.getActiveCount();
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Return the number of currently active threads.
* <p>Requires an underlying {@link ScheduledThreadPoolExecutor}.
* @see #getScheduledThreadPoolExecutor()
* @see java.util.concurrent.ScheduledThreadPoolExecutor#getActiveCount()
*/
public int getActiveCount() {
if (this.scheduledExecutor == null) {
// Not initialized yet: assume no active threads.
return 0;
}
return getScheduledThreadPoolExecutor().getActiveCount();
}
代码示例来源:origin: audit4j/audit4j-core
/**
* Return the number of currently active threads.
* <p>
* Requires an underlying {@link ScheduledThreadPoolExecutor}.
*
* @return the active count
* @see #getScheduledThreadPoolExecutor()
* @see java.util.concurrent.ScheduledThreadPoolExecutor#getActiveCount()
*/
public int getActiveCount() {
if (this.scheduledExecutor == null) {
// Not initialized yet: assume no active threads.
return 0;
}
return getScheduledThreadPoolExecutor().getActiveCount();
}
代码示例来源:origin: dimovelev/metrics-sampler
@Override
public Map<String, Object> getStats() {
final String prefix = "thread-pools." + getName() + ".";
final Map<String, Object> result = new HashMap<>();
result.put(prefix + "activeCount", executorService.getActiveCount());
result.put(prefix + "poolSize", executorService.getPoolSize());
result.put(prefix + "completedTaskCount", executorService.getCompletedTaskCount());
return result;
}
}
代码示例来源:origin: com.github.dimovelev/metrics-sampler-extension-base
@Override
public Map<String, Object> getStats() {
final String prefix = "thread-pools." + getName() + ".";
final Map<String, Object> result = new HashMap<>();
result.put(prefix + "activeCount", executorService.getActiveCount());
result.put(prefix + "poolSize", executorService.getPoolSize());
result.put(prefix + "completedTaskCount", executorService.getCompletedTaskCount());
return result;
}
}
代码示例来源:origin: actframework/actframework
@Command(value = "act.job.scheduler", help = "Show Job manager scheduler status")
public String getSchedulerStatus(JobManager jobManager) {
ScheduledThreadPoolExecutor executor = jobManager.executor();
JSONObject json = new JSONObject();
json.put("is terminating", executor.isTerminating());
json.put("is terminated", executor.isTerminated());
json.put("is shutdown", executor.isShutdown());
json.put("# of runnable in the queue", executor.getQueue().size());
json.put("active count", executor.getActiveCount());
json.put("# of completed tasks", executor.getActiveCount());
json.put("core pool size", executor.getCorePoolSize());
json.put("pool size", executor.getPoolSize());
return json.toJSONString();
}
代码示例来源:origin: org.actframework/act
@Command(value = "act.job.scheduler", help = "Show Job manager scheduler status")
public String getSchedulerStatus(JobManager jobManager) {
ScheduledThreadPoolExecutor executor = jobManager.executor();
JSONObject json = new JSONObject();
json.put("is terminating", executor.isTerminating());
json.put("is terminated", executor.isTerminated());
json.put("is shutdown", executor.isShutdown());
json.put("# of runnable in the queue", executor.getQueue().size());
json.put("active count", executor.getActiveCount());
json.put("# of completed tasks", executor.getActiveCount());
json.put("core pool size", executor.getCorePoolSize());
json.put("pool size", executor.getPoolSize());
return json.toJSONString();
}
代码示例来源:origin: OpenNMS/opennms
private synchronized void scheduleReads(final ScheduledThreadPoolExecutor executor) {
LOG.debug("scheduleReads: acquired lock, creating schedule...");
executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
m_future = executor.scheduleWithFixedDelay(this.getAckProcessor(), getSchedule().getInitialDelay(),
getSchedule().getInterval(), getSchedule().getUnit());
LOG.debug("scheduleReads: exited lock, schedule updated.");
LOG.debug("scheduleReads: schedule is: attempts remaining: {}; initial delay: {}; interval: {}; unit: {}",
getSchedule().getAttemptsRemaining(),
getSchedule().getInitialDelay(),
getSchedule().getInterval(),
getSchedule().getUnit());
LOG.debug("scheduleReads: executor details: active count: {}; completed task count: {}; task count: {}; queue size: {}", executor.getActiveCount(), executor.getCompletedTaskCount(), executor.getTaskCount(), executor.getQueue().size());
}
内容来源于网络,如有侵权,请联系作者删除!