<commit_before>package requester

import (
	"github.com/wenjiax/stress/stress/reportor"
	"net/http"
)

type Events struct {
	RequestBefore func(*Request, Share)
	ResponseAfter func(*http.Response, Share)
	ReportHandler func([]*reportor.Result)
}

//Share is a container that is shared in the current transaction,
//you can access the required content.
type Share map[string]interface{}

type Request struct {
	URLStr    string
	Method    string
	RoutineNo int
	Index     int
	body      *[]byte
	header    http.Header
}

func (r *Request) SetBody(bodyStr string) {
	*r.body = []byte(bodyStr)
}

func (r *Request) SetHeader(key, value string) {
	_, ok := (r.header)[key]
	if ok {
		r.header.Add(key, value)
	} else {
		r.header.Set(key, value)
	}
}<commit_msg>Update events.go<commit_after>package requester

import (
	"net/http"
	"time"

	"github.com/wenjiax/stress/stress/reportor"
)

type Events struct {
	RequestBefore func(*Request, Share)
	ResponseAfter func(*http.Response, Share)
	ReportHandler func([]*reportor.Result, time.Duration)
}

//Share is a container that is shared in the current transaction,
//you can access the required content.
type Share map[string]interface{}

type Request struct {
	Req       *http.Request
	RoutineNo int
	Index     int
}
{'fraction_non_alphanumeric': 0.1133122028526149, 'fraction_numerical': 0.0, 'mean_word_length': 4.113360323886639, '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': '3071642', 'n_tokens_mistral': 426, 'n_tokens_neox': 417, 'n_words': 121}