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

      // Test case that only a single result will be returned per RPC to the serer
      baseScan.setCaching(1);
      testRowsSeenMetric(baseScan);

      // Test case that partial results are returned from the server. At most one cell will be
      // contained in each response
      baseScan.setMaxResultSize(1);
      testRowsSeenMetric(baseScan);

      // Test case that size limit is set such that a few cells are returned per partial result from
      // the server
      baseScan.setCaching(NUM_ROWS);
      baseScan.setMaxResultSize(getCellHeapSize() * (NUM_COLS - 1));
      testRowsSeenMetric(baseScan);
    } catch (Throwable t) {
      LOG.error("FAIL", t);
      throw t;
    }
  }
@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