use of org.apache.ignite.spi.systemview.view.StripedExecutorTaskView in project ignite by apache.
the class PoolProcessor method registerMetrics.
/**
* Registers thread pools metrics and system views.
*/
public void registerMetrics() {
monitorExecutor("GridUtilityCacheExecutor", utilityCacheExecSvc);
monitorExecutor("GridExecutionExecutor", execSvc);
monitorExecutor("GridServicesExecutor", svcExecSvc);
monitorExecutor("GridSystemExecutor", sysExecSvc);
monitorExecutor("GridClassLoadingExecutor", p2pExecSvc);
monitorExecutor("GridManagementExecutor", mgmtExecSvc);
monitorExecutor("GridAffinityExecutor", affExecSvc);
monitorExecutor("GridCallbackExecutor", callbackExecSvc);
monitorExecutor("GridQueryExecutor", qryExecSvc);
monitorExecutor("GridSchemaExecutor", schemaExecSvc);
monitorExecutor("GridRebalanceExecutor", rebalanceExecSvc);
monitorExecutor("GridRebalanceStripedExecutor", rebalanceStripedExecSvc);
monitorStripedPool("GridDataStreamExecutor", dataStreamerExecSvc);
if (idxExecSvc != null)
monitorExecutor("GridIndexingExecutor", idxExecSvc);
if (ctx.config().getConnectorConfiguration() != null)
monitorExecutor("GridRestExecutor", restExecSvc);
if (stripedExecSvc != null) {
// Striped executor uses a custom adapter.
monitorStripedPool("StripedExecutor", stripedExecSvc);
}
if (snpExecSvc != null)
monitorExecutor("GridSnapshotExecutor", snpExecSvc);
if (thinClientExec != null)
monitorExecutor("GridThinClientExecutor", thinClientExec);
if (reencryptExecSvc != null)
monitorExecutor("GridReencryptionExecutor", reencryptExecSvc);
if (customExecs != null) {
for (Map.Entry<String, ? extends ExecutorService> entry : customExecs.entrySet()) monitorExecutor(entry.getKey(), entry.getValue());
}
ctx.systemView().registerInnerCollectionView(SYS_POOL_QUEUE_VIEW, SYS_POOL_QUEUE_VIEW_DESC, new StripedExecutorTaskViewWalker(), Arrays.asList(stripedExecSvc.stripes()), StripedExecutor.Stripe::queue, StripedExecutorTaskView::new);
ctx.systemView().registerInnerCollectionView(STREAM_POOL_QUEUE_VIEW, STREAM_POOL_QUEUE_VIEW_DESC, new StripedExecutorTaskViewWalker(), Arrays.asList(dataStreamerExecSvc.stripes()), StripedExecutor.Stripe::queue, StripedExecutorTaskView::new);
}
use of org.apache.ignite.spi.systemview.view.StripedExecutorTaskView in project ignite by apache.
the class SystemViewSelfTest method checkStripeExecutorView.
/**
* Checks striped executor system view.
*
* @param execSvc Striped executor.
* @param view System view.
* @param poolName Executor name.
*/
private void checkStripeExecutorView(StripedExecutor execSvc, SystemView<StripedExecutorTaskView> view, String poolName) throws Exception {
CountDownLatch latch = new CountDownLatch(1);
execSvc.execute(0, new TestRunnable(latch, 0));
execSvc.execute(0, new TestRunnable(latch, 1));
execSvc.execute(1, new TestRunnable(latch, 2));
execSvc.execute(1, new TestRunnable(latch, 3));
try {
boolean res = waitForCondition(() -> view.size() == 2, 5_000);
assertTrue(res);
Iterator<StripedExecutorTaskView> iter = view.iterator();
assertTrue(iter.hasNext());
StripedExecutorTaskView row0 = iter.next();
assertEquals(0, row0.stripeIndex());
assertEquals(TestRunnable.class.getSimpleName() + '1', row0.description());
assertEquals(poolName + "-stripe-0", row0.threadName());
assertEquals(TestRunnable.class.getName(), row0.taskName());
assertTrue(iter.hasNext());
StripedExecutorTaskView row1 = iter.next();
assertEquals(1, row1.stripeIndex());
assertEquals(TestRunnable.class.getSimpleName() + '3', row1.description());
assertEquals(poolName + "-stripe-1", row1.threadName());
assertEquals(TestRunnable.class.getName(), row1.taskName());
} finally {
latch.countDown();
}
}
Aggregations