squash! Updated structs and tests.
Updated structs and tests.
Signed-off-by: Frank Davidson <davidfr@americas.manulife.net>
Signed-off-by: Frank Davidson <ffdavidson@gmail.com>
Signed-off-by: Frank Davidson <frank_davidson@manulife.com>
At high traffic levels, the locking around sending on channels can cause
a large amount of blocking and CPU usage. These adds an event queue
mechanism so that events are queued for short period of time, and
flushed in batches to the main exporter goroutine periodically.
The default is is to flush every 1000 events, or every 200ms, whichever
happens first.
Signed-off-by: Clayton O'Neill <claytono@github.com>
This converts the byte buffer to a string by casting and parses the
string by looping over it instead of calling Split.
This usage of unsafe is taken from the strings.Builder package here:
cb5c82bc3d/src/strings/builder.go (L47)
Signed-off-by: Clayton O'Neill <claytono@github.com>
This adds the ability to accept Datadog's distribution type and treat it
like a histogram/summary.
Signed-off-by: Clayton O'Neill <claytono@github.com>
* add TCP StatsD listener support
* add listen-tcp flag to control UDP/TCP mode on same port
* statsdListenUDP/statsdListenTCP as string, and alias listen-address to listen-udp
* add stats for tcp error/line_too_long
* add test for TCP listener
There is no need to add the string to all event types as only Gauge
is compatible with inc/dec functionality. Removed valueStr from all
events and added a simple boolean to the Gauge event instead
Datadog's format extensions allow attaching labels and tags to statsd
metrics, and are documented at
http://docs.datadoghq.com/guides/dogstatsd/#datagram-format
Additionally changes compare method in tests to reflect.DeepEqual, as
the tag maps don't sort deterministically, corrects an inversion in
displaying test failure cases, and treats an invalid sample value as 1
instead of throwing out the sample.