INNER CODE UNIT · Go
oneMegabyte
sensu/sensu-go · cmd/loadit/main.go:48
oneMegabyte := make([]byte, 1024*1024)
for i := range oneMegabyte {
oneMegabyte[i] = byte(rand.Uint32() % 255)
}
oneMegabyteString := base64.StdEncoding.EncodeToString(oneMegabyte)
command.CannedResponse.Output = oneMegabyteString
}
go func() {
log.Println(http.ListenAndServe(fmt.Sprintf("localhost:%d", *flagProfilingPort), nil))
}()
logrus.SetLevel(logrus.WarnLevel)
subscriptions := strings.Split(*flagSubscriptions, ",")
backends := strings.Split(*flagBackends, ",")
ctx, cancel := context.WithCancel(context.Background())