Enable metrics for core queues

The following queues will provide metrics:

* index_batch
* index_interactive
* receive_commits
* send_email
* ssh_batch_worker
* ssh_command_start
* ssh_interactive_worker
* ssh_stream_worker

For each queue following metrics are available:

* active_threads - Number of threads that are actively executing tasks
* max_pool_size - Maximum allowed number of threads in the pool
* pool_size - Current number of threads in the pool
* scheduled_tasks - Number of scheduled tasks in the queue
* total_completed_tasks_count - Total number of tasks that have completed execution
* total_scheduled_tasks_count - Total number of tasks that have been scheduled

Change-Id: I9430c2a90d1fb07630c1c8b599abf6dd18e01b2d
Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
This commit is contained in:
Eryk Szymanski
2018-05-30 22:42:20 +02:00
committed by David Pursehouse
parent 366c3a652e
commit 04586d81fd
6 changed files with 31 additions and 15 deletions

View File

@@ -41,7 +41,7 @@ public class ReceiveCommitsExecutorModule extends AbstractModule {
int poolSize =
config.getInt(
"receive", null, "threadPoolSize", Runtime.getRuntime().availableProcessors());
return queues.createQueue(poolSize, "ReceiveCommits");
return queues.createQueue(poolSize, "ReceiveCommits", true);
}
@Provides
@@ -53,7 +53,7 @@ public class ReceiveCommitsExecutorModule extends AbstractModule {
if (poolSize == 0) {
return MoreExecutors.newDirectExecutorService();
}
return queues.createQueue(poolSize, "SendEmail");
return queues.createQueue(poolSize, "SendEmail", true);
}
@Provides

View File

@@ -181,7 +181,8 @@ public class IndexModule extends LifecycleModule {
if (threads <= 0) {
threads = Runtime.getRuntime().availableProcessors() / 2 + 1;
}
return MoreExecutors.listeningDecorator(workQueue.createQueue(threads, "Index-Interactive"));
return MoreExecutors.listeningDecorator(
workQueue.createQueue(threads, "Index-Interactive", true));
}
@Provides
@@ -199,7 +200,8 @@ public class IndexModule extends LifecycleModule {
if (batchThreads <= 0) {
batchThreads = Runtime.getRuntime().availableProcessors();
}
return MoreExecutors.listeningDecorator(workQueue.createQueue(batchThreads, "Index-Batch"));
return MoreExecutors.listeningDecorator(
workQueue.createQueue(batchThreads, "Index-Batch", true));
}
@Singleton