double percent = regionStats.getMemStoreLoadPercent() / 100.0; float heapOccupancy = regionStats.getHeapOccupancyPercent() / 100.0f; float compactionPressure = regionStats.getCompactionPressure() / 100.0f; if (heapOccupancy >= heapOccupancyLowWatermark) {
/** * Good enough attempt. Last writer wins. It doesn't really matter which one gets to update, * as something gets set * @param region * @param currentStats */ public void update(byte[] region, RegionLoadStats currentStats) { RegionStatistics regionStat = this.stats.get(region); if(regionStat == null){ regionStat = new RegionStatistics(); this.stats.put(region, regionStat); } regionStat.update(currentStats); }
ServerStatistics.RegionStatistics regionStats = serverStats.getStatsForRegion(regionName); assertEquals("We did not find some load on the memstore", load, regionStats.getMemStoreLoadPercent()); assertEquals(name, rsStats.name); assertEquals(rsStats.heapOccupancyHist.getSnapshot().getMean(), (double)regionStats.getHeapOccupancyPercent(), 0.1 ); assertEquals(rsStats.memstoreLoadHist.getSnapshot().getMean(), (double)regionStats.getMemStoreLoadPercent(), 0.1);
double percent = regionStats.getMemstoreLoadPercent() / 100.0; float heapOccupancy = regionStats.getHeapOccupancyPercent() / 100.0f; float compactionPressure = regionStats.getCompactionPressure() / 100.0f; if (heapOccupancy >= heapOccupancyLowWatermark) {
double percent = regionStats.getMemStoreLoadPercent() / 100.0; float heapOccupancy = regionStats.getHeapOccupancyPercent() / 100.0f; float compactionPressure = regionStats.getCompactionPressure() / 100.0f; if (heapOccupancy >= heapOccupancyLowWatermark) {
@Test public void testMutateRowStats() throws IOException { Configuration conf = UTIL.getConfiguration(); ClusterConnection conn = (ClusterConnection) ConnectionFactory.createConnection(conf); Table table = conn.getTable(tableName); HRegionServer rs = UTIL.getHBaseCluster().getRegionServer(0); Region region = rs.getRegions(tableName).get(0); RowMutations mutations = new RowMutations(Bytes.toBytes("row")); Put p = new Put(Bytes.toBytes("row")); p.addColumn(family, qualifier, Bytes.toBytes("value2")); mutations.add(p); table.mutateRow(mutations); ServerStatisticTracker stats = conn.getStatisticsTracker(); assertNotNull( "No stats configured for the client!", stats); // get the names so we can query the stats ServerName server = rs.getServerName(); byte[] regionName = region.getRegionInfo().getRegionName(); // check to see we found some load on the memstore ServerStatistics serverStats = stats.getServerStatsForTesting(server); ServerStatistics.RegionStatistics regionStats = serverStats.getStatsForRegion(regionName); assertNotNull(regionStats); assertTrue(regionStats.getMemStoreLoadPercent() > 0); } }
/** * Good enough attempt. Last writer wins. It doesn't really matter which one gets to update, * as something gets set * @param region * @param currentStats */ public void update(byte[] region, ClientProtos.RegionLoadStats currentStats) { RegionStatistics regionStat = this.stats.get(region); if(regionStat == null){ regionStat = new RegionStatistics(); this.stats.put(region, regionStat); } regionStat.update(currentStats); }
/** * Good enough attempt. Last writer wins. It doesn't really matter which one gets to update, * as something gets set * @param region * @param currentStats */ public void update(byte[] region, RegionLoadStats currentStats) { RegionStatistics regionStat = this.stats.get(region); if(regionStat == null){ regionStat = new RegionStatistics(); this.stats.put(region, regionStat); } regionStat.update(currentStats); }
double percent = regionStats.getMemStoreLoadPercent() / 100.0; float heapOccupancy = regionStats.getHeapOccupancyPercent() / 100.0f; float compactionPressure = regionStats.getCompactionPressure() / 100.0f; if (heapOccupancy >= heapOccupancyLowWatermark) {
/** * Good enough attempt. Last writer wins. It doesn't really matter which one gets to update, * as something gets set * @param region * @param currentStats */ public void update(byte[] region, RegionLoadStats currentStats) { RegionStatistics regionStat = this.stats.get(region); if(regionStat == null){ regionStat = new RegionStatistics(); this.stats.put(region, regionStat); } regionStat.update(currentStats); }
ServerStatistics.RegionStatistics regionStats = serverStats.getStatsForRegion(regionName); assertEquals("We did not find some load on the memstore", load, regionStats.getMemStoreLoadPercent()); assertEquals(name, rsStats.name); assertEquals(rsStats.heapOccupancyHist.getSnapshot().getMean(), (double)regionStats.getHeapOccupancyPercent(), 0.1 ); assertEquals(rsStats.memstoreLoadHist.getSnapshot().getMean(), (double)regionStats.getMemStoreLoadPercent(), 0.1);
@Test public void testMutateRowStats() throws IOException { Configuration conf = UTIL.getConfiguration(); ClusterConnection conn = (ClusterConnection) ConnectionFactory.createConnection(conf); Table table = conn.getTable(tableName); HRegionServer rs = UTIL.getHBaseCluster().getRegionServer(0); Region region = rs.getRegions(tableName).get(0); RowMutations mutations = new RowMutations(Bytes.toBytes("row")); Put p = new Put(Bytes.toBytes("row")); p.addColumn(family, qualifier, Bytes.toBytes("value2")); mutations.add(p); table.mutateRow(mutations); ServerStatisticTracker stats = conn.getStatisticsTracker(); assertNotNull( "No stats configured for the client!", stats); // get the names so we can query the stats ServerName server = rs.getServerName(); byte[] regionName = region.getRegionInfo().getRegionName(); // check to see we found some load on the memstore ServerStatistics serverStats = stats.getServerStatsForTesting(server); ServerStatistics.RegionStatistics regionStats = serverStats.getStatsForRegion(regionName); assertNotNull(regionStats); assertTrue(regionStats.getMemStoreLoadPercent() > 0); } }