File tree Expand file tree Collapse file tree 5 files changed +25
-30
lines changed Expand file tree Collapse file tree 5 files changed +25
-30
lines changed Original file line number Diff line number Diff line change 1+ All development activity takes place on github.
2+
3+ If you think you've discovered a bug, or you would like
4+ to make a feature request please do this through github.
Original file line number Diff line number Diff line change 11# DataDog Server mock
22
3- 2MB golang server listening on port 8125 writing metrics to stdout.
3+ golang server listening on port 8125 writing metrics to stdout. (datadog/mock 3.02MB)
44
55### Bootstrap
66
7- ```
8- make install
9- make test
10- ```
7+ Require docker to assembly
8+
9+ ` make install test `
1110
1211### Running
1312
14- ```
15- make run
16- `` `
13+ automagically
14+
15+ ` make run `
1716
18- or
17+ run in docker
1918
20- ```
21- docker run -it --log-driver none --rm -p 0.0.0.0:8125:8125/UDP datadog/mock
22- ```
19+ ` docker run -it --log-driver none --rm -p 0.0.0.0:8125:8125/UDP datadog/mock `
2320
24- or
21+ run on host
2522
26- ```
27- ./target/datadog_mock
28- ```
23+ ` ./target/datadog_mock `
2924
3025
3126### Verify
3227
33- When datadog/mock is running
28+ When datadog/mock is running run manually
3429
35- ```
36- echo "deploys.test.myservice:1|c" > /dev/udp/127.0.0.1/8125
37- ```
30+ ` echo "deploys.test.myservice:1|c" > /dev/udp/127.0.0.1/8125 `
3831
39- or
32+ or send MESSAGE repeat EACH second
4033
41- ```
42- EACH=.001 ./dev/event-producer.sh
43- ```
34+ ` MESSAGE="deploys.test.myservice:1|c" EACH=.001 ./dev/event-producer.sh `
4435
Original file line number Diff line number Diff line change @@ -5,16 +5,16 @@ set -eo pipefail
55trap exit INT TERM
66
77# ###
8- sample=" deploys.test.myservice:1|c"
98
109[ -z $EACH ] && EACH=2 || :
10+ [ -z $MESSAGE ] && MESSAGE=" deploys.test.myservice:1|c" || :
1111
12- printf " [info] sending \" %s\" every %ssec\n" $sample $EACH
12+ printf " [info] sending \" %s\" every %ssec\n" $MESSAGE $EACH
1313
1414# ###
1515
1616while true ; do
17- echo $sample > /dev/udp/127.0.0.1/8125
17+ echo $MESSAGE > /dev/udp/127.0.0.1/8125
1818 sleep $EACH
1919done
2020
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ func main() {
2626 stream , err := net .ResolveUDPAddr ("udp" , ":8125" )
2727
2828 if err != nil {
29- fmt .Println ("Fatal: %v" , err )
29+ fmt .Println (err )
3030 os .Exit (1 )
3131 }
3232
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ func (r *sink) Run(addr *net.UDPAddr) {
2828 inputStreamConn , err := net .ListenUDP ("udp" , addr )
2929
3030 if err != nil {
31- fmt .Println ("Fatal: %v" , err )
31+ fmt .Println (err )
3232 os .Exit (1 )
3333 }
3434
@@ -39,7 +39,7 @@ func (r *sink) Run(addr *net.UDPAddr) {
3939forever:
4040 n , _ , err := inputStreamConn .ReadFromUDP (buf )
4141 if err != nil {
42- fmt .Println ("Error: %v" , err )
42+ fmt .Println (err )
4343 goto forever
4444 }
4545
You can’t perform that action at this time.
0 commit comments