<commit_before>package main

import (
	"bytes"
	"crypto/tls"
	"encoding/json"
	"log"
	"net/http"
	"os"
	"strconv"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/foolusion/certs"
	"github.com/tsenart/vegeta/lib"
)

var config = struct {
	rate     uint64
	duration time.Duration
	target   string
	bucket   string
	key      string
}{
	rate:     100,
	duration: time.Minute,
	target:   "http://internal-46111-CXAR-ATO-Elwin-LB-2059848312.us-west-2.elb.amazonaws.com/epe/123",
	bucket:   "cxar-ato-team",
	key:      "elwin/perf.json",
}

func main() {
	if os.Getenv("RATE") != "" {
		if i, err := strconv.Atoi(os.Getenv("RATE")); err == nil {
			config.rate = uint64(i)
		}
	}
	if os.Getenv("DURATION") != "" {
		if dur, err := time.ParseDuration(os.Getenv("DURATION")); err == nil {
			config.duration = dur
		}
	}
	if os.Getenv("TARGET") != "" {
		config.target = os.Getenv("TARGET")
	}
	if os.Getenv("BUCKET") != "" {
		config.bucket = os.Getenv("BUCKET")
	}
	if os.Getenv("KEY") != "" {
		config.key = os.Getenv("KEY")
	}

	targeter := vegeta.NewStaticTargeter(vegeta.Target{
		Method: "GET",
		URL:    config.target,
	})

	attacker := vegeta.NewAttacker()

	var metrics vegeta.Metrics
	for res := range attacker.Attack(targeter, config.rate, config.duration) {
		metrics.Add(res)
	}<commit_msg>removed nordstrom specific data from perf test<commit_after>package main

import (
	"bytes"
	"crypto/tls"
	"encoding/json"
	"log"
	"net/http"
	"os"
	"strconv"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/foolusion/certs"
	"github.com/tsenart/vegeta/lib"
)

var config = struct {
	rate     uint64
	duration time.Duration
	target   string
	bucket   string
	key      string
}{
	rate:     100,
	duration: time.Minute,
	key:      "elwin/perf.json",
}

func main() {
	if os.Getenv("RATE") != "" {
		if i, err := strconv.Atoi(os.Getenv("RATE")); err == nil {
			config.rate = uint64(i)
		}
	}
	if os.Getenv("DURATION") != "" {
		if dur, err := time.ParseDuration(os.Getenv("DURATION")); err == nil {
			config.duration = dur
		}
	}
	if os.Getenv("TARGET") != "" {
		config.target = os.Getenv("TARGET")
	}
	if config.target == "" {
		log.Fatal("target must be set")
	}
	if os.Getenv("BUCKET") != "" {
		config.bucket = os.Getenv("BUCKET")
	}
	// TODO: only works for aws buckets...
	if config.bucket == "" {
		log.Fatal("bucket must be set")
	}
	if os.Getenv("KEY") != "" {
		config.key = os.Getenv("KEY")
	}

	targeter := vegeta.NewStaticTargeter(vegeta.Target{
		Method: "GET",
		URL:    config.target,
	})

	attacker := vegeta.NewAttacker()

	var metrics vegeta.Metrics
	for res := range attacker.Attack(targeter, config.rate, config.duration) {
		metrics.Add(res)
	}
{'fraction_non_alphanumeric': 0.18229901269393511, 'fraction_numerical': 0.01234132581100141, 'mean_word_length': 3.337920489296636, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4064449', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1155, 'n_words': 202}