use of org.apache.ignite.spi.systemview.view.CacheGroupIoView in project ignite by apache.
the class SystemViewSelfTest method testCacheGroupIo.
/**
*/
@Test
public void testCacheGroupIo() throws Exception {
cleanPersistenceDir();
try (IgniteEx ignite = startGrid(getConfiguration().setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))))) {
ignite.cluster().state(ClusterState.ACTIVE);
IgniteCache<Object, Object> cache = ignite.createCache("cache");
cache.put(0, 0);
cache.get(0);
SystemView<CacheGroupIoView> view = ignite.context().systemView().view(CACHE_GRP_IO_VIEW);
CacheGroupIoView row = F.find(view, null, (IgnitePredicate<CacheGroupIoView>) r -> "cache".equals(r.cacheGroupName()));
assertNotNull(row);
assertTrue(row.logicalReads() > 0);
}
}
use of org.apache.ignite.spi.systemview.view.CacheGroupIoView in project ignite by apache.
the class GridCacheProcessor method start.
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "unchecked" })
@Override
public void start() throws IgniteCheckedException {
ctx.internalSubscriptionProcessor().registerMetastorageListener(recovery);
ctx.internalSubscriptionProcessor().registerDatabaseListener(recovery);
cachesInfo = new ClusterCachesInfo(ctx);
DeploymentMode depMode = ctx.config().getDeploymentMode();
if (!F.isEmpty(ctx.config().getCacheConfiguration())) {
if (depMode != CONTINUOUS && depMode != SHARED)
U.warn(log, "Deployment mode for cache is not CONTINUOUS or SHARED " + "(it is recommended that you change deployment mode and restart): " + depMode);
}
Collection<CacheStoreSessionListener> sessionListeners = CU.startStoreSessionListeners(ctx, ctx.config().getCacheStoreSessionListenerFactories());
sharedCtx = createSharedContext(ctx, sessionListeners);
locCfgMgr = new GridLocalConfigManager(this, ctx);
transactions = new IgniteTransactionsImpl(sharedCtx, null, false);
// Start shared managers.
for (GridCacheSharedManager mgr : sharedCtx.managers()) mgr.start(sharedCtx);
if (!ctx.isDaemon() && (!CU.isPersistenceEnabled(ctx.config())) || ctx.config().isClientMode()) {
CacheJoinNodeDiscoveryData data = locCfgMgr.restoreCacheConfigurations();
if (data != null)
cachesInfo.onStart(data);
}
if (log.isDebugEnabled())
log.debug("Started cache processor.");
ctx.state().cacheProcessorStarted();
ctx.systemView().registerFiltrableView(CACHE_GRP_PAGE_LIST_VIEW, CACHE_GRP_PAGE_LIST_VIEW_DESC, new CachePagesListViewWalker(), this::pagesListViewSupplier, Function.identity());
ctx.systemView().registerFiltrableView(PART_STATES_VIEW, PART_STATES_VIEW_DESC, new PartitionStateViewWalker(), this::partStatesViewSupplier, Function.identity());
ctx.systemView().registerView(CACHE_GRP_IO_VIEW, CACHE_GRP_IO_VIEW_DESC, new CacheGroupIoViewWalker(), () -> F.view(cacheGrps.values(), grp -> !grp.systemCache()), grpCtx -> {
MetricRegistry mreg = ctx.metric().registry(metricName(IoStatisticsType.CACHE_GROUP.metricGroupName(), grpCtx.cacheOrGroupName()));
return new CacheGroupIoView(grpCtx, mreg);
});
}
Aggregations