@Override public CacheStatistics getStatistics() throws StatisticsDisabledException { return this.realRegion.getStatistics(); }
public CacheStatistics getStatistics() { return this.region.getStatistics(); }
public float getHitRatio() { if (isStatisticsEnabled) { return region.getStatistics().getHitRatio(); } return ManagementConstants.NOT_AVAILABLE_FLOAT; }
public long getHitCount() { if (isStatisticsEnabled) { return region.getStatistics().getHitCount(); } return ManagementConstants.NOT_AVAILABLE_LONG; }
public long getMissCount() { if (isStatisticsEnabled) { return region.getStatistics().getMissCount(); } return ManagementConstants.NOT_AVAILABLE_LONG; }
public long getLastAccessedTime() { if (isStatisticsEnabled) { return region.getStatistics().getLastAccessedTime(); } return ManagementConstants.NOT_AVAILABLE_LONG; }
public long getLastModifiedTime() { if (isStatisticsEnabled) { return region.getStatistics().getLastModifiedTime(); } return ManagementConstants.NOT_AVAILABLE_LONG; }
/** * Returns a <code>RegionStatisticsResponse</code> that will be returned to the specified * recipient. The message will contains a copy of the local manager's system config. */ public static RegionStatisticsResponse create(DistributionManager dm, InternalDistributedMember recipient, Region r) { RegionStatisticsResponse m = new RegionStatisticsResponse(); m.setRecipient(recipient); m.regionStatistics = new RemoteCacheStatistics(r.getStatistics()); return m; }
public RemoteRegionSnapshot(Region r) throws CacheException { this.name = r.getName(); RegionAttributes rAttr = r.getAttributes(); this.attributes = new RemoteRegionAttributes(rAttr); if (rAttr.getStatisticsEnabled()) { this.stats = new RemoteCacheStatistics(r.getStatistics()); } else { this.stats = new RemoteCacheStatistics(); } this.attributes = new RemoteRegionAttributes(r.getAttributes()); Set nameSet = r.keySet(); this.entryCount = nameSet.size(); Set subRegions = r.subregions(false); this.subregionCount = subRegions.size(); Object attr = r.getUserAttribute(); if (attr != null) { this.userAttribute = attr.getClass().getName() + "\"" + attr.toString() + "\""; } else { this.userAttribute = null; } }
CacheStatistics stats = region.getStatistics(); long lastAccessed = stats.getLastAccessedTime(); long lastModified = stats.getLastModifiedTime(); CacheStatistics stats2 = region.getStatistics(); assertEquals(lastAccessed, stats2.getLastAccessedTime()); assertEquals(lastModified, stats2.getLastModifiedTime());
protected RegionMBeanBridge(Region<K, V> region) { this.region = region; this.regAttrs = region.getAttributes(); this.isStatisticsEnabled = regAttrs.getStatisticsEnabled(); if (isStatisticsEnabled) { try { region.getStatistics(); } catch (UnsupportedOperationException e) { this.isStatisticsEnabled = false; } } this.regionAttributesData = RegionMBeanCompositeDataFactory.getRegionAttributesData(regAttrs); this.membershipAttributesData = RegionMBeanCompositeDataFactory.getMembershipAttributesData(regAttrs); this.evictionAttributesData = RegionMBeanCompositeDataFactory.getEvictionAttributesData(regAttrs); this.regionMonitor = new MBeanStatsMonitor("RegionMXBeanMonitor"); configureRegionMetrics(); this.persistentEnabled = region.getAttributes().getDataPolicy().withPersistence(); this.regionStats = ((LocalRegion) region).getRegionPerfStats(); if (regionStats != null) { regionMonitor.addStatisticsToMonitor(regionStats.getStats()); // fixes 46692 } monitorLRUStatistics(); if (regAttrs.getGatewaySenderIds() != null && regAttrs.getGatewaySenderIds().size() > 0) { this.isGatewayEnabled = true; } this.member = GemFireCacheImpl.getInstance().getDistributedSystem().getMemberId(); }
region.getStatistics(); fail("Should have thrown a RegionDestroyedException");
region.getStatistics(); fail("Should have thrown a RegionDestroyedException");
public static CacheStatistics resolve(Region<?, ?> region) { return Optional.ofNullable(region) .map(it -> PartitionRegionHelper.isPartitionedRegion(it) ? new PartitionRegionCacheStatistics(region) : it.getStatistics()) .orElse(null); }