Package jetbrains.buildServer.diagnostic
Class TeamCityDiagnosticService
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- java.util.concurrent.ScheduledThreadPoolExecutor
-
- jetbrains.buildServer.util.executors.TeamCityScheduledThreadPoolExecutor
-
- jetbrains.buildServer.diagnostic.TeamCityDiagnosticService
-
- All Implemented Interfaces:
Executor
,ExecutorService
,ScheduledExecutorService
,ExecutorServiceEx
public class TeamCityDiagnosticService extends TeamCityScheduledThreadPoolExecutor
Created by Andrey Titov on 11.09.15. Scheduled executor to run self-service tasks as long requests watcher, periodic thread dump saver an so on. Handles tasks execution and timeout updating.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TeamCityDiagnosticService.Task
-
Nested classes/interfaces inherited from class jetbrains.buildServer.util.executors.TeamCityScheduledThreadPoolExecutor
TeamCityScheduledThreadPoolExecutor.RunnableScheduledFutureWrapper<V>
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TeamCityDiagnosticService
getInstance()
int
getQueuedTasksCount()
protected Set<TeamCityDiagnosticService.Task>
getTasks()
void
scheduleTask(TeamCityDiagnosticService.Task task)
boolean
stopTask(TeamCityDiagnosticService.Task task)
-
Methods inherited from class jetbrains.buildServer.util.executors.TeamCityScheduledThreadPoolExecutor
afterExecute, beforeExecute, decorateTask, decorateTask
-
Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor
execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submit
-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
Methods inherited from interface jetbrains.buildServer.util.executors.ExecutorServiceEx
getActiveCount
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static TeamCityDiagnosticService getInstance()
-
scheduleTask
public void scheduleTask(TeamCityDiagnosticService.Task task)
-
stopTask
public boolean stopTask(@NotNull TeamCityDiagnosticService.Task task)
-
getQueuedTasksCount
public int getQueuedTasksCount()
- Specified by:
getQueuedTasksCount
in interfaceExecutorServiceEx
- Overrides:
getQueuedTasksCount
in classTeamCityScheduledThreadPoolExecutor
- Returns:
- count of tasks in queue (not filtered - some can be cancelled)
-
getTasks
@NotNull protected Set<TeamCityDiagnosticService.Task> getTasks()
-
-