<commit_before>package main

import (
	"github.com/streadway/amqp"
	"koding/tools/amqputil"
	"log"
	"math/rand"
	"strconv"
)

var scale int = 1e4
var concurrent int = scale / 10 // we assume a very large percentage of concurrent users

func userNum(i int) string {
	return "user" + strconv.Itoa(i)
}

func main() {
	startStressTest()
	select {}
}

func startStressTest() {
	conn := amqputil.CreateConnection("ffconsume")
	channel := amqputil.CreateChannel(conn)
	done := make(chan error)

	var err error

	for i := 0; i < scale; i++ {

		err = channel.ExchangeDeclare(
			userNum(i), // name
			"direct",   // kind
			false,      // durable
			false,      // auto-delete
			false,      // internal
			false,      // no-wait
			nil,        // args
		)

		if err != nil {
			panic(err)
		}
	}

	var bindings int = 0

	for i := 0; i < scale; i++ {
		r := rand.Intn(10)

		source := userNum(i)

		for j := 0; j < r; j++ {
			destination := userNum(rand.Intn(scale))

			channel.ExchangeBind(
				destination, // destination
				destination, // key
				source,      // source
				false,
				nil, // args
			)

			bindings++
		}
	}

	log.Print(strconv.Itoa(bindings) + " E2E bindings created")

	for i := 0; i < concurrent; i++ {

		key := userNum(i)

		channel.QueueDeclare(
			"",    // name
			false, // durable
			true,  // auto-delete
			true,  // exclusive
			false, // no-wait
			nil,   // args
		)

		channel.QueueBind(
			"",    // name
			key,   // key
			key,   // exchange
			false, // no-wait
			nil,   // args
		)

		deliveries, err := channel.Consume(
			"",    // name
			"",    // consumer tag
			false, // no ack
			false, // exclusive
			false, // no local
			false, // no wait
			nil,   // args
		)

		if err != nil {
			panic(err)
		}

		go handle(deliveries, done)

	}

	log.Print(strconv.Itoa(concurrent) + " queues created and bound")
}
<commit_msg>followfeed: tweak these settings a bit<commit_after>package main

import (
	"github.com/streadway/amqp"
	"koding/tools/amqputil"
	"log"
	"math/rand"
	"strconv"
)

var scale int = 1e4
var concurrent int = scale / 10 // we assume a very large percentage of concurrent users

func userNum(i int) string {
	return "user" + strconv.Itoa(i)
}

func main() {
	startStressTest()
	select {}
}

func startStressTest() {
	conn := amqputil.CreateConnection("ffconsume")
	channel := amqputil.CreateChannel(conn)
	done := make(chan error)

	var err error

	for i := 0; i < scale; i++ {

		err = channel.ExchangeDeclare(
			userNum(i), // name
			"direct",   // kind
			false,      // durable
			false,      // auto-delete
			false,      // internal
			false,      // no-wait
			nil,        // args
		)

		if err != nil {
			panic(err)
		}
	}

	var bindings int = 0

	for i := 0; i < scale; i++ {
		r := rand.Intn(10)

		source := userNum(i)

		for j := 0; j < r; j++ {
			destination := userNum(rand.Intn(scale))

			channel.ExchangeBind(
				destination, // destination
				destination, // key
				source,      // source
				false,
				nil, // args
			)

			bindings++
		}
	}

	log.Print(strconv.Itoa(bindings) + " E2E bindings created")

	for i := 0; i < concurrent; i++ {

		key := userNum(i)

		channel.QueueDeclare(
			"",    // name
			false, // durable
			true,  // auto-delete
			false, // exclusive
			false, // no-wait
			nil,   // args
		)

		channel.QueueBind(
			"",    // name
			key,   // key
			key,   // exchange
			false, // no-wait
			nil,   // args
		)

		deliveries, err := channel.Consume(
			"",    // name
			"",    // consumer tag
			true,  // auto ack
			false, // exclusive
			false, // no local
			false, // no wait
			nil,   // args
		)

		if err != nil {
			panic(err)
		}

		go handle(deliveries, done)

	}

	log.Print(strconv.Itoa(concurrent) + " queues created and bound")
}

{'fraction_non_alphanumeric': 0.149162456793406, 'fraction_numerical': 0.006381281574049455, 'mean_word_length': 2.1194029850746268, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '350722', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1367, 'n_words': 351}