// Path: hangout-core/src/main/java/com/ctrip/ops/sysdev/baseplugin/BaseMetric.java
// public abstract class BaseMetric extends Base {
//     public BaseMetric(Map config) {
//         super(config);
//     }
// 
//     public void register() {
//     }
// }
// 
// Path: hangout-core/src/main/java/com/ctrip/ops/sysdev/metric/Metric.java
// public  class Metric {
// 
//     private static MetricRegistry metricRegistry = new MetricRegistry();
// 
//     public static Meter setMetric(String metricName) {
//         return metricRegistry.meter(metricName);
//     }
// 
//     public static MetricRegistry getMetricRegistry()
//     {
//         return metricRegistry;
//     }
// }


import com.codahale.metrics.MetricFilter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.MetricSet;
import com.codahale.metrics.graphite.GraphiteReporter;
import com.codahale.metrics.graphite.PickledGraphite;
import com.ctrip.ops.sysdev.baseplugin.BaseMetric;
import lombok.extern.log4j.Log4j2;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.ctrip.ops.sysdev.metric.Metric;
package com.ctrip.ops.sysdev.metrics;




/**
 * Created by liujia on 17/7/4.
 */

@Log4j2
public class Graphit extends BaseMetric {

    private final String host;
    private final int port;
    private String prefix;
    private HashMap<String, ArrayList<String>> metrics;
    private final MetricRegistry metricRegistry = new MetricRegistry();

    public Graphit(Map config) {
        super(config);

        this.host = (String) config.get("host");
        this.port = (Integer) config.get("port");
        this.prefix = (String) config.get("prefix");
        this.metrics = (HashMap<String, ArrayList<String>>) config.get("metrics");
    }

    public void register() {
// Path: hangout-core/src/main/java/com/ctrip/ops/sysdev/baseplugin/BaseMetric.java
// public abstract class BaseMetric extends Base {
//     public BaseMetric(Map config) {
//         super(config);
//     }
// 
//     public void register() {
//     }
// }
// 
// Path: hangout-core/src/main/java/com/ctrip/ops/sysdev/metric/Metric.java
// public  class Metric {
// 
//     private static MetricRegistry metricRegistry = new MetricRegistry();
// 
//     public static Meter setMetric(String metricName) {
//         return metricRegistry.meter(metricName);
//     }
// 
//     public static MetricRegistry getMetricRegistry()
//     {
//         return metricRegistry;
//     }
// }


// Path: hangout-metric-plugins/hangout-metric-graphit/src/main/java/com/ctrip/ops/sysdev/metrics/Graphit.java
import com.codahale.metrics.MetricFilter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.MetricSet;
import com.codahale.metrics.graphite.GraphiteReporter;
import com.codahale.metrics.graphite.PickledGraphite;
import com.ctrip.ops.sysdev.baseplugin.BaseMetric;
import lombok.extern.log4j.Log4j2;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.ctrip.ops.sysdev.metric.Metric;

package com.ctrip.ops.sysdev.metrics;




/**
 * Created by liujia on 17/7/4.
 */

@Log4j2
public class Graphit extends BaseMetric {

    private final String host;
    private final int port;
    private String prefix;
    private HashMap<String, ArrayList<String>> metrics;
    private final MetricRegistry metricRegistry = new MetricRegistry();

    public Graphit(Map config) {
        super(config);

        this.host = (String) config.get("host");
        this.port = (Integer) config.get("port");
        this.prefix = (String) config.get("prefix");
        this.metrics = (HashMap<String, ArrayList<String>>) config.get("metrics");
    }

    public void register() {
        this.metricRegistry.registerAll(Metric.getMetricRegistry());