func (s *Client) Timing(stat string, delta int64, rate float32, tags ...Tag) error {
	if !s.includeStat(rate) {
		return nil
	}
	return s.submit(stat, "", delta, "|ms", rate, tags)
}
Timing submits a statsd timing type.
stat is a string name for the metric.
delta is the time duration value in milliseconds
rate is the sample rate (0.0 to 1.0).
package statsd
import (
	"fmt"
	"math/rand"
	"strconv"
	"strings"
	"time"
)
var bufPool = newBufferPool()
type StatSender interface {
	Inc(string, int64, float32, ...Tag) error
	Dec(string, int64, float32, ...Tag) error
	Gauge(string, int64, float32, ...Tag) error
	GaugeDelta(string, int64, float32, ...Tag) error
	Timing(string, int64, float32, ...Tag) error
	TimingDuration(string, time.Duration, float32, ...Tag) error
	Set(string, string, float32, ...Tag) error
	SetInt(string, int64, float32, ...Tag) error
	Raw(string, string, float32, ...Tag) error
}
type Statter interface {
	StatSender
	NewSubStatter(string) SubStatter
	SetPrefix(string)
	Close() error
}
type SubStatter interface {
	StatSender
	SetSamplerFunc(SamplerFunc)
	NewSubStatter(string) SubStatter
}
type SamplerFunc func(float32) bool
func DefaultSampler(rate float32) bool {
	if rate < 1 {
		return rand.Float32() < rate
	}
	return true
}
type Client struct {
	prefix string
	sender Sender
	sampler SamplerFunc
	tagFormat TagFormat
}
func (s *Client) Close() error {
	if s == nil {
		return nil
	}
	err := s.sender.Close()
	return err
}
func (s *Client) Inc(stat string, value int64, rate float32, tags ...Tag) error {
	if !s.includeStat(rate) {
		return nil
	}
	return s.submit(stat, "", value, "|c", rate, tags)
}
func (s *Client) Dec(stat string, value int64, rate float32, tags ...Tag) error {
	if !s.includeStat(rate) {
		return nil
	}
	return s.submit(stat, "", -value, "|c", rate, tags)
}
func (s *Client) Gauge(stat string, value int64, rate float32, tags ...Tag) error {
	if !s.includeStat(rate) {
		return nil
	}
	return s.submit(stat, "", value, "|g", rate, tags)
}
func (s *Client) GaugeDelta(stat string, value int64, rate float32, tags ...Tag) error {
	if !s.includeStat(rate) {
		return nil
	}
	if value >= 0 {
		return s.submit(stat, "+", value, "|g", rate, tags)
	}
	return s.submit(stat, "", value, "|g", rate, tags)
}