class LookoutRegistryMetricReader implements MetricReader, MetricRegistryListener {

    @Override
    public Iterable<Metric<?>> findAll() {
        final Iterator<com.alipay.lookout.api.Metric> lookoutIt = this.springBootActuatorRegistry
            .iterator();
        return new Iterable<Metric<?>>() {
            @Override
            public Iterator<Metric<?>> iterator() {
                List<Metric<?>> metricsRes = new LinkedList<Metric<?>>();
                while (lookoutIt.hasNext()) {
                    com.alipay.lookout.api.Metric lookoutMetric = lookoutIt.next();
                    Id id = lookoutMetric.id();
                    Collection<Metric> metricList = findMetricsById(id);
                    if (metricList != null && metricList.size() > 0) {
                        for (Metric metric : metricList) {
                            metricsRes.add(metric);
                        }
                    }
                }
                return metricsRes.iterator();
            }
        };
    }

    public  LookoutRegistryMetricReader(SpringBootActuatorRegistry springBootActuatorRegistry);

}