func (c *Client) HandleMeasures(time time.Time, measures ...stats.Measure) {
	c.buffer.HandleMeasures(time, measures...)
}
HandleMeasures satisfies the stats.Handler interface.
package datadog
import (
	"bytes"
	"io"
	"log"
	"net"
	"os"
	"syscall"
	"time"
	"github.com/segmentio/stats/v4"
)
const (
	DefaultAddress = "localhost:8125"
	DefaultBufferSize = 1024
	MaxBufferSize = 65507
)
var (
	DefaultFilters = []string{"http_req_path"}
	DefaultDistributionPrefixes = []string{}
)
type ClientConfig struct {
	Address string
	BufferSize int
	Filters []string
	DistributionPrefixes []string
}
type Client struct {
	serializer
	err    error
	buffer stats.Buffer
}
func NewClient(addr string) *Client {
	return NewClientWith(ClientConfig{
		Address: addr,
	})
}
func NewClientWith(config ClientConfig) *Client {
	if len(config.Address) == 0 {
		config.Address = DefaultAddress
	}
	if config.BufferSize == 0 {
		config.BufferSize = DefaultBufferSize
	}
	if config.Filters == nil {
		config.Filters = DefaultFilters
	}
	if config.DistributionPrefixes == nil {
		config.DistributionPrefixes = DefaultDistributionPrefixes
	}
	filterMap := make(map[string]struct{})
	for _, f := range config.Filters {
		filterMap[f] = struct{}{}
	}
	c := &Client{
		serializer: serializer{
			filters:      filterMap,
			distPrefixes: config.DistributionPrefixes,
		},
	}
	conn, bufferSize, err := dial(config.Address, config.BufferSize)
	if err != nil {
		log.Printf("stats/datadog: %s", err)
	}
	c.conn, c.err, c.bufferSize = conn, err, bufferSize
	c.buffer.BufferSize = bufferSize
	c.buffer.Serializer = &c.serializer
	log.Printf("stats/datadog: sending metrics with a buffer of size %d B", bufferSize)
	return c
}