Пример #1
0
func InitCommandLineFlags(config config.Config) {
	config.IntVar(&params.iterations, "iterations", 1, "number of pushes to attempt")
	config.IntVar(&params.concurrency, "concurrency", 1, "max number of pushes to attempt in parallel")
	config.BoolVar(&params.silent, "silent", false, "true to run the commands and print output the terminal")
	config.StringVar(&params.output, "output", "", "if specified, writes benchmark results to a CSV file")
	config.StringVar(&params.workload, "workload", "", "The set of operations a user should issue (ex. login,push,push)")
	config.IntVar(&params.interval, "interval", 0, "repeat a workload at n second interval, to be used with -stop")
	config.IntVar(&params.stop, "stop", 0, "stop a repeating interval after n second, to be used with -interval")
	config.StringVar(&params.csvDir, "csvDir", "output/csvs", "Directory to Store CSVs")
	restContext.DescribeParameters(config)
}
Пример #2
0
func (c *Context) DescribeParameters(config config.Config) {
	config.StringVar(&c.target, "rest:target", "", "the target for the REST api")
	config.StringVar(&c.username, "rest:username", "", "username for REST api")
	config.StringVar(&c.password, "rest:password", "", "password for REST api")
}
Пример #3
0
func InitCommandLineFlags(flags config.Config) {
	flags.StringVar(&params.csvDir, "csvDir", "output/csvs", "Directory to Store CSVs")
}
Пример #4
0
package pat_test

import (
	. "github.com/julz/pat"
	"github.com/julz/pat/benchmarker"
	"github.com/julz/pat/config"
	"github.com/julz/pat/experiment"
	"github.com/julz/pat/laboratory"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Cmdline", func() {
	var (
		flags  config.Config
		args   []string
		lab    *dummyLab
		worker benchmarker.Worker
	)

	JustBeforeEach(func() {
		flags = config.NewConfig()
		InitCommandLineFlags(flags)
		flags.Parse(args)
		lab = &dummyLab{}
		worker = benchmarker.NewWorker()
		RunCommandLineWithLabAndWorker(lab, worker)
	})

	Describe("When -iterations is supplied", func() {
		BeforeEach(func() {
			args = []string{"-iterations", "3"}