@@ -0,0 +1,3177 @@
+/*%0A * Copyright 2014-2015 Open Networking Laboratory%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.onlab.metrics;%0A%0A%0Aimport com.codahale.metrics.Counter;%0Aimport com.codahale.metrics.Histogram;%0Aimport com.codahale.metrics.Meter;%0Aimport com.codahale.metrics.Timer;%0Aimport com.codahale.metrics.Gauge;%0Aimport com.codahale.metrics.Metric;%0Aimport com.codahale.metrics.MetricFilter;%0A%0Aimport java.util.Collections;%0Aimport java.util.Map;%0A%0A/**%0A * Test adapter for metrics service.%0A */%0Apublic class MetricsServiceAdapter implements MetricsService %7B%0A%0A    @Override%0A    public MetricsComponent registerComponent(String name) %7B%0A        MetricsComponent metricsComponent = new MetricsComponent(name);%0A        return metricsComponent;%0A    %7D%0A%0A    @Override%0A    public Counter createCounter(MetricsComponent component,%0A                                 MetricsFeature feature, String metricName) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Histogram createHistogram(MetricsComponent component,%0A                                     MetricsFeature feature, String metricName) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Timer createTimer(MetricsComponent component,%0A                             MetricsFeature feature, String metricName) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Meter createMeter(MetricsComponent component,%0A                             MetricsFeature feature, String metricName) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public %3CT extends Metric%3E T registerMetric(MetricsComponent component,%0A                                               MetricsFeature feature, String metricName, T metric) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public boolean removeMetric(MetricsComponent component,%0A                                MetricsFeature feature, String metricName) %7B%0A        return false;%0A    %7D%0A%0A    @Override%0A    public Map%3CString, Timer%3E getTimers(MetricFilter filter) %7B%0A        return Collections.emptyMap();%0A    %7D%0A%0A    @Override%0A    public Map%3CString, Gauge%3E getGauges(MetricFilter filter) %7B%0A        return Collections.emptyMap();%0A    %7D%0A%0A    @Override%0A    public Map%3CString, Counter%3E getCounters(MetricFilter filter) %7B%0A        return Collections.emptyMap();%0A    %7D%0A%0A    @Override%0A    public Map%3CString, Meter%3E getMeters(MetricFilter filter) %7B%0A        return Collections.emptyMap();%0A    %7D%0A%0A    @Override%0A    public Map%3CString, Histogram%3E getHistograms(MetricFilter filter) %7B%0A        return Collections.emptyMap();%0A    %7D%0A%0A    @Override%0A    public Map%3CString, Metric%3E getMetrics() %7B%0A        return Collections.emptyMap();%0A    %7D%0A%0A    @Override%0A    public void removeMatching(MetricFilter filter) %7B%0A    %7D%0A%7D%0A

Add MetricsServiceAdapter for unit test