public static ProcedureMetrics convertToProcedureMetrics(final OperationMetrics metrics) {
    return new ProcedureMetrics() {
      @Override
      public Counter getSubmittedCounter() {
        return metrics.getSubmittedCounter();
      }

      @Override
      public Histogram getTimeHisto() {
        return metrics.getTimeHisto();
      }

      @Override
      public Counter getFailedCounter() {
        return metrics.getFailedCounter();
      }
    };
  }
This is utility function that converts {@link OperationMetrics} to {@link ProcedureMetrics}.
NOTE: Procedure framework in hbase-procedure module accesses metrics common to most procedures
through {@link ProcedureMetrics} interface. Metrics source classes in hbase-hadoop-compat
module provides similar interface {@link OperationMetrics} that contains metrics common to most
operations. As both hbase-procedure and hbase-hadoop-compat are lower level modules used by
hbase-server (this) module and there is no dependency between them, this method does the
required conversion.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java