Example #1
0
func NewTracer(statsdUrl, namespace string) (*Tracer, error) {
	c, err := statsdClient.Dial(statsdUrl)

	if err != nil {
		return nil, err
	}

	return &Tracer{c, namespace, defaultRateTime, defaultRateIncrement}, nil
}
Example #2
0
func NewMetric(statsdURL string) *Metric {
	var client *statsd.Client
	var err error

	if statsdURL != "" {
		client, err = statsd.Dial(statsdURL)

		if err != nil {
			log.Println(err.Error())

			return nil
		}
	}

	return &Metric{client}
}