-
-
Save remeh/a046e761f7cd7b40ab89c489484c1c41 to your computer and use it in GitHub Desktop.
DogStatsD no-aggregation and normal traffic
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
package main | |
import ( | |
"log" | |
"strconv" | |
"time" | |
"github.com/DataDog/datadog-go/v5/statsd" | |
) | |
func main() { | |
// configure your socket here | |
client, err := statsd.New("unix:///Users/remy.mathieu/statsd.sock", | |
statsd.WithTags([]string{"env:test", "service:agent-qa"}), | |
statsd.WithoutClientSideAggregation(), | |
) | |
if err != nil { | |
log.Fatal(err) | |
} | |
for i := 0; i < 50000000; i++ { | |
m := int(i % 100) | |
client.CountWithTimestamp("dogstatsd.metric.with_ts.qa"+strconv.Itoa(m), int64(100+m), []string{"dev:agent", "team:agent-metrics-logs"}, 1.0, time.Now()) | |
} | |
client.Close() | |
} |
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
package main | |
import ( | |
"log" | |
"strconv" | |
"github.com/DataDog/datadog-go/v5/statsd" | |
) | |
func main() { | |
// configure your socket here | |
client, err := statsd.New("unix:///Users/remy.mathieu/statsd.sock", | |
statsd.WithTags([]string{"env:test", "service:agent-qa"}), | |
statsd.WithoutClientSideAggregation(), | |
) | |
if err != nil { | |
log.Fatal(err) | |
} | |
for i := 0; i < 50000000; i++ { | |
m := int(i % 100) | |
client.Distribution("dogstatsd.metric.dist.qa" + strconv.Itoa(m), float64(100), []string{"dev:agent", "team:agent-metrics-logs"}, 1.0) | |
} | |
client.Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment