protected void initScanMetrics(Scan scan) {
    // check if application wants to collect scan metrics
    if (scan.isScanMetricsEnabled()) {
      scanMetrics = new ScanMetrics();
    }
  }
Check and initialize if application wants to collect scan metrics
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java