<commit_before>package simple

import (
	log "github.com/Sirupsen/logrus"
	"github.com/loadimpact/speedboat"
	"github.com/loadimpact/speedboat/sampler"
	"github.com/valyala/fasthttp"
	"golang.org/x/net/context"
	"math"
	"time"
)

type Runner struct {
	Test speedboat.Test

	mDuration *sampler.Metric
	mErrors   *sampler.Metric
}

type VU struct {
	Runner  *Runner
	Client  fasthttp.Client
	Request fasthttp.Request
}

func New(t speedboat.Test) *Runner {
	return &Runner{
		Test:      t,
		mDuration: sampler.Stats("request.duration"),
		mErrors:   sampler.Counter("request.error"),
	}
}

func (r *Runner) NewVU() (speedboat.VU, error) {
	vu := &VU{
		Runner: r,
		Client: fasthttp.Client{MaxConnsPerHost: math.MaxInt32},
	}

	vu.Request.SetRequestURI(r.Test.URL)

	return vu, nil
}

func (u *VU) Reconfigure(id int64) error {
	return nil
}

func (u *VU) RunOnce(ctx context.Context) error {
	res := fasthttp.AcquireResponse()
	defer fasthttp.ReleaseResponse(res)

	startTime := time.Now()
	err := u.Client.Do(&u.Request, res)
	duration := time.Since(startTime)

	u.Runner.mDuration.WithFields(sampler.Fields{
		"url":    u.Runner.Test.URL,
		"method": "GET",
		"status": res.StatusCode(),
	}).Duration(duration)

	if err != nil {
		log.WithError(err).Error("Request error")
		u.Runner.mErrors.WithField("url", u.Runner.Test.URL).Int(1)
		return err
	}

	return nil
}<commit_msg>[fix] Log method and status from URL runs as well<commit_after>package simple

import (
	log "github.com/Sirupsen/logrus"
	"github.com/loadimpact/speedboat"
	"github.com/loadimpact/speedboat/sampler"
	"github.com/valyala/fasthttp"
	"golang.org/x/net/context"
	"math"
	"time"
)

type Runner struct {
	Test speedboat.Test

	mDuration *sampler.Metric
	mErrors   *sampler.Metric
}

type VU struct {
	Runner  *Runner
	Client  fasthttp.Client
	Request fasthttp.Request
}

func New(t speedboat.Test) *Runner {
	return &Runner{
		Test:      t,
		mDuration: sampler.Stats("request.duration"),
		mErrors:   sampler.Counter("request.error"),
	}
}

func (r *Runner) NewVU() (speedboat.VU, error) {
	vu := &VU{
		Runner: r,
		Client: fasthttp.Client{MaxConnsPerHost: math.MaxInt32},
	}

	vu.Request.SetRequestURI(r.Test.URL)

	return vu, nil
}

func (u *VU) Reconfigure(id int64) error {
	return nil
}

func (u *VU) RunOnce(ctx context.Context) error {
	res := fasthttp.AcquireResponse()
	defer fasthttp.ReleaseResponse(res)

	startTime := time.Now()
	err := u.Client.Do(&u.Request, res)
	duration := time.Since(startTime)

	u.Runner.mDuration.WithFields(sampler.Fields{
		"url":    u.Runner.Test.URL,
		"method": "GET",
		"status": res.StatusCode(),
	}).Duration(duration)

	if err != nil {
		log.WithError(err).Error("Request error")
		u.Runner.mErrors.WithFields(sampler.Fields{
			"url":    u.Runner.Test.URL,
			"method": "GET",
			"status": res.StatusCode(),
		}).Int(1)
		return err
	}

	return nil
}
{'fraction_non_alphanumeric': 0.15001740341106856, 'fraction_numerical': 0.003480682213713888, 'mean_word_length': 4.1138790035587185, 'pattern_counts': {'":': 9, '<': 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': '6369917', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1087, 'n_words': 219}