// Metrics creates a singleton client for submitting metrics to DogStatsD
Metrics creates a singleton client for submitting metrics to DogStatsD
// Metrics creates a singleton client for submitting metrics to DogStatsD
func Metrics() *statsd.Client {
	once.Do(func() {
		metricsClientConf := config.Metrics()["client"].(map[string]interface{})
		conn := fmt.Sprintf("%s:%d", metricsClientConf["host"], metricsClientConf["port"])
		instance, err := statsd.New(conn)
		if err != nil {
			log.Info("Unable to initialize statsd client.")
			panic(err)
		}
		instance.Namespace = metricsClientConf["prefix"].(string)
	})
	return instance
}
func Metrics ( ) * statsd . Client { once . Do ( func ( ) { metricsClientConf := config . Metrics ( ) [ " " ] . ( map [ string ] interface { } ) conn := fmt . Sprintf ( " " , metricsClientConf [ " " ] , metricsClientConf [ " " ] ) instance , err := statsd . New ( conn ) if err != nil { log . Info ( " " ) panic ( err ) } instance . Namespace = metricsClientConf [ " " ] . ( string ) } ) return instance }
Metrics creates a singleton client for submitting metrics to DogStatsD
Metrics creates a singleton client for submitting metrics to DogStatsD