public void initializeQuotaOCMetrics(List<OperationController> ocList) {
    List<QuotaAwareOperationController> quotaAwareOperationControllers = ocList.stream()
        .filter(oc -> (oc instanceof QuotaAwareOperationController))
        .map(oc -> (QuotaAwareOperationController) oc)
        .collect(Collectors.toList());
    outOfQuotaResourcesInQueue =
        metricRegistry.gauge(MetricRegistry.name(NonBlockingRouter.class, "OutOfQuotaResourcesInQueue"),
            () -> () -> quotaAwareOperationControllers.stream()
                .mapToInt(oc -> oc.getOutOfQuotaResourcesInQueue())
                .sum());
    delayedQuotaResourcesInQueue =
        metricRegistry.gauge(MetricRegistry.name(NonBlockingRouter.class, "DelayedQuotaResourcesInQueue"),
            () -> () -> quotaAwareOperationControllers.stream()
                .mapToInt(oc -> oc.getDelayedQuotaResourcesInQueue())
                .sum());
  }
Initialize {@link Gauge} metrics to monitor if any requests are being delayed or are out of quota.
This is relevant only for {@link QuotaAwareOperationController}s because its the only {@link OperationController}
that tracks quota.
@param ocList {@link List} of {@link OperationController} object.
ambry-router/src/main/java/com/github/ambry/router/NonBlockingRouterMetrics.java