Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
package main
import (
var (
num = 1
rps int64 = 1000
func init() {
flag.IntVar(&num, "n", num, "number of different metrics to generate")
flag.Int64Var(&rps, "r", rps, "the metrics per second to send")
func main() {
limiter := ratelimit.NewBucketWithRate(float64(rps), rps)
for n := runtime.NumCPU(); n >= 0; n-- {
go beAJerk(limiter)
func beAJerk(limiter *ratelimit.Bucket) {
sender, _ := datagram.NewSender("localhost", 8125)
for {
Type: datagram.Histogram,
Name: "jerks." + strconv.Itoa(rand.Intn(num)),
Value: rand.Float64(),
SampleRate: 1,
func waitForSignal() {
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM)
log.Println("kill signal received")