This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
forked from segmentio/stats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Achille Roussel
committed
Jan 6, 2017
1 parent
a0055de
commit 185df39
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ _testmain.go | |
|
||
# Emacs | ||
*~ | ||
|
||
# Commands | ||
/dogstatsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang:alpine | ||
|
||
COPY . /go/src/github.com/segmentio/stats | ||
|
||
ENV CGO_ENABLED=0 | ||
RUN apk add --no-cache git && \ | ||
cd /go/src/github.com/segmentio/stats && \ | ||
go build -v -o /dogstatsd ./cmd/dogstatsd && \ | ||
apk del git && \ | ||
rm -rf /go/* | ||
|
||
ENTRYPOINT ["/dogstatsd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"log" | ||
"net" | ||
|
||
"github.com/segmentio/stats/datadog" | ||
) | ||
|
||
func main() { | ||
var bind string | ||
|
||
flag.StringVar(&bind, "bind", ":8125", "The network address to listen on for incoming UDP datagrams") | ||
flag.Parse() | ||
log.Printf("listening for incoming UDP datagram on %s", bind) | ||
|
||
datadog.ListenAndServe(bind, datadog.HandlerFunc(func(metric datadog.Metric, from net.Addr) { | ||
log.Print(metric) | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters