@Test
  public void testRowsFilteredMetric() throws Exception {
    // Base scan configuration
    Scan baseScan;
    baseScan = new Scan();
    baseScan.setScanMetricsEnabled(true);

    // Test case where scan uses default values
    testRowsFilteredMetric(baseScan);

    // Test case where at most one Result is retrieved per RPC
    baseScan.setCaching(1);
    testRowsFilteredMetric(baseScan);

    // Test case where size limit is very restrictive and partial results will be returned from
    // server
    baseScan.setMaxResultSize(1);
    testRowsFilteredMetric(baseScan);

    // Test a case where max result size limits response from server to only a few cells (not all
    // cells from the row)
    baseScan.setCaching(NUM_ROWS);
    baseScan.setMaxResultSize(getCellHeapSize() * (NUM_COLS - 1));
    testRowsSeenMetric(baseScan);
  }
@return The approximate heap size of a cell in the test table. All cells should have
        approximately the same heap size, so the value is cached to avoid repeating the
        calculation
@throws Exception on unexpected failure
hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java