From 6f03572e681e1c0e98100c51822a8439143998b8 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 08:20:59 +0400 Subject: [PATCH 01/11] Run go-ycsb benchmarks --- cmd/dance/main.go | 5 +- internal/config/runner.go | 13 +- internal/configload/configload.go | 4 +- internal/configload/runner.go | 15 +++ internal/runner/ycsb/ycsb.go | 214 +++++++++++++++--------------- internal/runner/ycsb/ycsb_test.go | 123 +++++++++-------- projects/_old/ycsb-workloada.yml | 21 --- projects/enmeshed-runtime | 2 +- projects/meteor | 2 +- projects/restheart | 2 +- projects/ycsb-workloada.yml | 33 +++++ projects/ycsb/workloads/workloada | 3 + projects/ycsb/workloads/workloadb | 3 + projects/ycsb/workloads/workloadc | 3 + projects/ycsb/workloads/workloadd | 40 ------ projects/ycsb/workloads/workloade | 44 ------ projects/ycsb/workloads/workloadf | 36 ----- 17 files changed, 238 insertions(+), 325 deletions(-) delete mode 100644 projects/_old/ycsb-workloada.yml create mode 100644 projects/ycsb-workloada.yml delete mode 100644 projects/ycsb/workloads/workloadd delete mode 100644 projects/ycsb/workloads/workloade delete mode 100644 projects/ycsb/workloads/workloadf diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 8dcb957be..4189bebe7 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -40,6 +40,7 @@ import ( "github.com/FerretDB/dance/internal/runner" "github.com/FerretDB/dance/internal/runner/command" "github.com/FerretDB/dance/internal/runner/gotest" + "github.com/FerretDB/dance/internal/runner/ycsb" ) func waitForPort(ctx context.Context, port int) error { @@ -173,10 +174,8 @@ func main() { runner, err = command.New(c.Params.(*config.RunnerParamsCommand), rl, cli.Verbose) case config.RunnerTypeGoTest: runner, err = gotest.New(c.Params.(*config.RunnerParamsGoTest), rl, cli.Verbose) - case config.RunnerTypeJSTest: - fallthrough case config.RunnerTypeYCSB: - fallthrough + runner, err = ycsb.New(c.Params.(*config.RunnerParamsYCSB), rl) default: log.Fatalf("unknown runner: %q", c.Runner) } diff --git a/internal/config/runner.go b/internal/config/runner.go index 3a48c99ba..7825170b6 100644 --- a/internal/config/runner.go +++ b/internal/config/runner.go @@ -24,9 +24,6 @@ const ( // RunnerTypeGoTest indicates a Go test runner. RunnerTypeGoTest RunnerType = "gotest" - // RunnerTypeJSTest indicates a JavaScript test runner. - RunnerTypeJSTest RunnerType = "jstest" - // RunnerTypeYCSB indicates a YCSB test runner. RunnerTypeYCSB RunnerType = "ycsb" ) @@ -63,8 +60,18 @@ type RunnerParamsGoTest struct { // runnerParams implements [RunnerParams] interface. func (rp *RunnerParamsGoTest) runnerParams() {} +// RunnerParamsYCSB represents `ycsb` runner parameters. +type RunnerParamsYCSB struct { + Dir string + Args []string +} + +// runnerParams implements [RunnerParams] interface. +func (rp *RunnerParamsYCSB) runnerParams() {} + // check interfaces var ( _ RunnerParams = (*RunnerParamsCommand)(nil) _ RunnerParams = (*RunnerParamsGoTest)(nil) + _ RunnerParams = (*RunnerParamsYCSB)(nil) ) diff --git a/internal/configload/configload.go b/internal/configload/configload.go index a3d8c2f62..8aa6df8fc 100644 --- a/internal/configload/configload.go +++ b/internal/configload/configload.go @@ -163,10 +163,8 @@ func loadContent(content, db string) (*config.Config, error) { p = &runnerParamsCommand{} case config.RunnerTypeGoTest: p = &runnerParamsGoTest{} - case config.RunnerTypeJSTest: - fallthrough case config.RunnerTypeYCSB: - fallthrough + p = &runnerParamsYCSB{} default: err = fmt.Errorf("unknown runner type %q", pc.Runner) } diff --git a/internal/configload/runner.go b/internal/configload/runner.go index d0c6ef936..d365aec1e 100644 --- a/internal/configload/runner.go +++ b/internal/configload/runner.go @@ -72,8 +72,23 @@ func (rp *runnerParamsGoTest) convert() (config.RunnerParams, error) { }, nil } +// runnerParamsYCSB represents `ycsb` runner parameters in the project configuration YAML file. +type runnerParamsYCSB struct { + Dir string `yaml:"dir"` + Args []string `yaml:"args"` +} + +// convert implements [runnerParams] interface. +func (rp *runnerParamsYCSB) convert() (config.RunnerParams, error) { + return &config.RunnerParamsYCSB{ + Dir: rp.Dir, + Args: rp.Args, + }, nil +} + // check interfaces var ( _ runnerParams = (*runnerParamsCommand)(nil) _ runnerParams = (*runnerParamsGoTest)(nil) + _ runnerParams = (*runnerParamsYCSB)(nil) ) diff --git a/internal/runner/ycsb/ycsb.go b/internal/runner/ycsb/ycsb.go index 2941d8d5e..5cb67d692 100644 --- a/internal/runner/ycsb/ycsb.go +++ b/internal/runner/ycsb/ycsb.go @@ -18,70 +18,102 @@ package ycsb import ( "bufio" "context" - "fmt" + "encoding/json" + "errors" "io" - "log" + "log/slog" "os" "os/exec" + "path" "path/filepath" "strings" "time" "github.com/FerretDB/dance/internal/config" + "github.com/FerretDB/dance/internal/runner" ) -// Measurements stores go-ycsb results. -type Measurements struct { - Takes time.Duration - Count int64 - OPS float64 - Avg time.Duration - Min time.Duration - Max time.Duration - Perc50 time.Duration - Perc90 time.Duration - Perc95 time.Duration - Perc99 time.Duration - Perc999 time.Duration - Perc9999 time.Duration +// measurement represents a single object in go-ycsb JSON array output. +type measurement struct { + Operation string `json:"Operation"` + TakesS float64 `json:"Takes(s),string"` + Count int `json:"Count,string"` + OPS float64 `json:"OPS,string"` + AvgUs float64 `json:"Avg(us),string"` + MinUs float64 `json:"Min(us),string"` + MaxUs float64 `json:"Max(us),string"` + Perc50Us float64 `json:"50th(us),string"` + Perc90Us float64 `json:"90th(us),string"` + Perc95Us float64 `json:"95th(us),string"` + Perc99Us float64 `json:"99th(us),string"` + Perc999Us float64 `json:"99.9th(us),string"` + Perc9999Us float64 `json:"99.99th(us),string"` } -// Run runs `go-ycsb`. -// -// It loads and runs a YCSB workload. -// Properties defined in the YAML file will override properties defined in the workload parameter file. -func Run(ctx context.Context, dir string, args []string) (map[string]config.TestResult, error) { - bin := filepath.Join("..", "bin", "go-ycsb") - if _, err := os.Stat(bin); err != nil { - return nil, err - } +// ycsb represents `ycsb` runner. +type ycsb struct { + p *config.RunnerParamsYCSB + l *slog.Logger +} - // because we set cmd.Dir, the relative path here is different - bin = filepath.Join("..", bin) +// New creates a new `ycsb` runner with given parameters. +func New(params *config.RunnerParamsYCSB, l *slog.Logger) (runner.Runner, error) { + return &ycsb{ + p: params, + l: l, + }, nil +} - // load workload +// parseOutput parses go-ycsb JSON output. +func parseOutput(r io.Reader) (map[string]map[string]float64, error) { + var res map[string]map[string]float64 - cliArgs := []string{"load", "mongodb", "-P", args[0]} - for _, p := range args[1:] { - cliArgs = append(cliArgs, "-p", p) - } + scanner := bufio.NewScanner(r) + for scanner.Scan() { + line := scanner.Text() - cmd := exec.CommandContext(ctx, bin, cliArgs...) - cmd.Dir = dir - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr + if strings.HasPrefix(line, "write exception:") { + return nil, errors.New("unexpected output") + } - log.Printf("Running %s", strings.Join(cmd.Args, " ")) + if !strings.HasPrefix(line, "[{") { + continue + } - if err := cmd.Run(); err != nil { - return nil, err + var ms []measurement + if err := json.Unmarshal([]byte(line), &ms); err != nil { + return nil, err + } + + res = make(map[string]map[string]float64) + for _, m := range ms { + res[strings.ToLower(m.Operation)] = map[string]float64{ + "takes": m.TakesS, + "count": float64(m.Count), + "ops": m.OPS, + "avg": (time.Duration(m.AvgUs) * time.Microsecond).Seconds(), + "min": (time.Duration(m.MinUs) * time.Microsecond).Seconds(), + "max": (time.Duration(m.MaxUs) * time.Microsecond).Seconds(), + "perc50": (time.Duration(m.Perc50Us) * time.Microsecond).Seconds(), + "perc90": (time.Duration(m.Perc90Us) * time.Microsecond).Seconds(), + "perc95": (time.Duration(m.Perc95Us) * time.Microsecond).Seconds(), + "perc99": (time.Duration(m.Perc99Us) * time.Microsecond).Seconds(), + "perc999": (time.Duration(m.Perc999Us) * time.Microsecond).Seconds(), + "perc9999": (time.Duration(m.Perc9999Us) * time.Microsecond).Seconds(), + } + } } - // run workload with almost the same args + if err := scanner.Err(); err != nil { + return res, err + } - cliArgs[0] = "run" + return res, nil +} - cmd = exec.CommandContext(ctx, bin, cliArgs...) +// run runs given command in the given directory and returns parsed results. +func run(ctx context.Context, args []string, dir string) (map[string]config.TestResult, error) { + cmd := exec.CommandContext(ctx, args[0], args[1:]...) cmd.Dir = dir cmd.Stderr = os.Stderr @@ -92,94 +124,58 @@ func Run(ctx context.Context, dir string, args []string) (map[string]config.Test defer pipe.Close() - res := map[string]config.TestResult{ - dir: { - Status: config.Pass, - }, - } - - log.Printf("Running %s", strings.Join(cmd.Args, " ")) - if err = cmd.Start(); err != nil { return nil, err } - m, err := parseMeasurements(io.TeeReader(pipe, os.Stdout)) + ms, err := parseOutput(io.TeeReader(pipe, os.Stdout)) if err != nil { _ = cmd.Process.Kill() return nil, err } - err = cmd.Wait() + if err = cmd.Wait(); err != nil { + return nil, err + } - switch err { - case nil: - // fmt.Printf("Parsed metrics: %+v\n\n", m) - _ = m - default: - res[dir] = config.TestResult{ - Status: config.Fail, - Output: err.Error(), + res := make(map[string]config.TestResult) + for t, m := range ms { + res[path.Join(dir, t)] = config.TestResult{ + Status: config.Pass, + Measurements: m, } } return res, nil } -// parseMeasurements parses go-ycsb output. -func parseMeasurements(r io.Reader) (map[string]Measurements, error) { - res := make(map[string]Measurements) +// Run implements [runner.Runner] interface. +func (y *ycsb) Run(ctx context.Context) (map[string]config.TestResult, error) { + bin := filepath.Join("..", "bin", "go-ycsb") + if _, err := os.Stat(bin); err != nil { + return nil, err + } - scanner := bufio.NewScanner(r) - for scanner.Scan() { - line := scanner.Text() - fields := strings.Fields(line) + bin, err := filepath.Abs(bin) + if err != nil { + return nil, err + } - if len(fields) == 0 { - continue - } + args := []string{bin, "load", "mongodb", "-P", y.p.Args[0]} + for _, p := range y.p.Args[1:] { + args = append(args, "-p", p) + } + args = append(args, "-p", "outputstyle=json") - prefix := fields[0] - - switch prefix { - case "TOTAL", "READ", "INSERT", "UPDATE": - var takes, ops float64 - var count, avg, vmin, vmax, perc50, perc90, perc95, perc99, perc999, perc9999 int64 - - // It is enough to use fmt.Sscanf for parsing the data as the string produced by go-ycsb has fixed format: - // https://github.com/pingcap/go-ycsb/blob/fe11c4783b57703465ec7d36fcc4268979001d1a/pkg/measurement/measurement.go#L28 - _, err := fmt.Sscanf( - line, - "%s - Takes(s): %f, Count: %d, OPS: %f, Avg(us): %d, Min(us): %d, Max(us): %d, "+ - "50th(us): %d, 90th(us): %d, 95th(us): %d, 99th(us): %d, 99.9th(us): %d, 99.99th(us): %d", - &prefix, &takes, &count, &ops, &avg, &vmin, &vmax, &perc50, &perc90, &perc95, &perc99, &perc999, &perc9999, - ) - if err != nil { - return res, err - } + y.l.InfoContext(ctx, "Load", slog.String("cmd", strings.Join(args, " "))) - res[prefix] = Measurements{ - Takes: time.Duration(takes * float64(time.Second)), - Count: count, - OPS: ops, - Avg: time.Duration(avg * int64(time.Microsecond)), - Min: time.Duration(vmin * int64(time.Microsecond)), - Max: time.Duration(vmax * int64(time.Microsecond)), - Perc50: time.Duration(perc50 * int64(time.Microsecond)), - Perc90: time.Duration(perc90 * int64(time.Microsecond)), - Perc95: time.Duration(perc95 * int64(time.Microsecond)), - Perc99: time.Duration(perc99 * int64(time.Microsecond)), - Perc999: time.Duration(perc999 * int64(time.Microsecond)), - Perc9999: time.Duration(perc9999 * int64(time.Microsecond)), - } - default: - // string doesn't contain metrics, do nothing - } + if _, err = run(ctx, args, y.p.Dir); err != nil { + return nil, err } - if err := scanner.Err(); err != nil { - return res, err - } + args[1] = "run" - return res, nil + y.l.InfoContext(ctx, "Run", slog.String("cmd", strings.Join(args, " "))) + + return run(ctx, args, y.p.Dir) } diff --git a/internal/runner/ycsb/ycsb_test.go b/internal/runner/ycsb/ycsb_test.go index 8a179ce53..c140452c9 100644 --- a/internal/runner/ycsb/ycsb_test.go +++ b/internal/runner/ycsb/ycsb_test.go @@ -17,89 +17,86 @@ package ycsb import ( "strings" "testing" - "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestParseMeasurements(t *testing.T) { + t.Parallel() + //nolint:lll // verbatim output - output := strings.NewReader(strings.TrimSpace(` -Using request distribution 'uniform' a keyrange of [0 4999] + output := strings.NewReader(` +Using request distribution 'uniform' a keyrange of [0 999] Connected to MongoDB! ***************** properties ***************** -"insertproportion"="0" -"requestdistribution"="uniform" -"readproportion"="0.5" -"updateproportion"="0.5" -"command"="run" "workload"="core" -"dotransactions"="true" +"recordcount"="1000" +"outputstyle"="json" +"readproportion"="0.5" "scanproportion"="0" +"requestdistribution"="uniform" +"dotransactions"="true" +"mongodb.url"="mongodb://127.0.0.1:37001/" "readallfields"="true" -"recordcount"="5000" -"operationcount"="100000" +"updateproportion"="0.5" +"insertproportion"="0" +"operationcount"="50000" +"command"="run" ********************************************** -READ - Takes(s): 10.0, Count: 19332, OPS: 1933.3, Avg(us): 247, Min(us): 138, Max(us): 1110, 50th(us): 243, 90th(us): 289, 95th(us): 317, 99th(us): 407, 99.9th(us): 661, 99.99th(us): 871 -TOTAL - Takes(s): 10.0, Count: 38456, OPS: 3845.7, Avg(us): 257, Min(us): 138, Max(us): 2773, 50th(us): 252, 90th(us): 302, 95th(us): 331, 99th(us): 441, 99.9th(us): 751, 99.99th(us): 1784 -UPDATE - Takes(s): 10.0, Count: 19124, OPS: 1912.6, Avg(us): 268, Min(us): 155, Max(us): 2773, 50th(us): 261, 90th(us): 310, 95th(us): 344, 99th(us): 475, 99.9th(us): 1218, 99.99th(us): 1803 -READ - Takes(s): 20.0, Count: 38557, OPS: 1927.9, Avg(us): 247, Min(us): 138, Max(us): 5299, 50th(us): 243, 90th(us): 285, 95th(us): 307, 99th(us): 390, 99.9th(us): 711, 99.99th(us): 2871 -TOTAL - Takes(s): 20.0, Count: 76910, OPS: 3845.6, Avg(us): 257, Min(us): 138, Max(us): 52799, 50th(us): 251, 90th(us): 297, 95th(us): 320, 99th(us): 417, 99.9th(us): 969, 99.99th(us): 2979 -UPDATE - Takes(s): 20.0, Count: 38353, OPS: 1917.8, Avg(us): 268, Min(us): 155, Max(us): 52799, 50th(us): 260, 90th(us): 305, 95th(us): 329, 99th(us): 441, 99.9th(us): 1720, 99.99th(us): 2979 +[{"50th(us)":"287","90th(us)":"328","95th(us)":"350","99.99th(us)":"1312","99.9th(us)":"777","99th(us)":"431","Avg(us)":"292","Count":"17129","Max(us)":"2407","Min(us)":"175","OPS":"1713.1","Operation":"READ","Takes(s)":"10.0"},{"50th(us)":"284","90th(us)":"325","95th(us)":"346","99.99th(us)":"2059","99.9th(us)":"781","99th(us)":"419","Avg(us)":"289","Count":"34279","Max(us)":"2407","Min(us)":"171","OPS":"3428.1","Operation":"TOTAL","Takes(s)":"10.0"},{"50th(us)":"281","90th(us)":"321","95th(us)":"342","99.99th(us)":"2059","99.9th(us)":"794","99th(us)":"410","Avg(us)":"286","Count":"17150","Max(us)":"2217","Min(us)":"171","OPS":"1715.1","Operation":"UPDATE","Takes(s)":"10.0"}] ********************************************** -Run finished, takes 25.957181042s -READ - Takes(s): 26.0, Count: 50216, OPS: 1934.6, Avg(us): 246, Min(us): 138, Max(us): 9735, 50th(us): 243, 90th(us): 284, 95th(us): 305, 99th(us): 381, 99.9th(us): 692, 99.99th(us): 2871 -TOTAL - Takes(s): 26.0, Count: 100000, OPS: 3852.6, Avg(us): 257, Min(us): 138, Max(us): 52799, 50th(us): 251, 90th(us): 296, 95th(us): 318, 99th(us): 405, 99.9th(us): 848, 99.99th(us): 2979 -UPDATE - Takes(s): 26.0, Count: 49784, OPS: 1918.0, Avg(us): 267, Min(us): 153, Max(us): 52799, 50th(us): 260, 90th(us): 304, 95th(us): 328, 99th(us): 430, 99.9th(us): 1684, 99.99th(us): 2979 -`) + "\n") +Run finished, takes 14.676689042s +[{"50th(us)":"288","90th(us)":"331","95th(us)":"353","99.99th(us)":"1312","99.9th(us)":"757","99th(us)":"427","Avg(us)":"293","Count":"25030","Max(us)":"2407","Min(us)":"175","OPS":"1705.6","Operation":"READ","Takes(s)":"14.7"},{"50th(us)":"285","90th(us)":"328","95th(us)":"349","99.99th(us)":"1913","99.9th(us)":"777","99th(us)":"421","Avg(us)":"291","Count":"50000","Max(us)":"2407","Min(us)":"171","OPS":"3406.9","Operation":"TOTAL","Takes(s)":"14.7"},{"50th(us)":"282","90th(us)":"324","95th(us)":"345","99.99th(us)":"2151","99.9th(us)":"786","99th(us)":"411","Avg(us)":"288","Count":"24970","Max(us)":"2261","Min(us)":"171","OPS":"1701.4","Operation":"UPDATE","Takes(s)":"14.7"}] +`) - actual, err := parseMeasurements(output) + actual, err := parseOutput(output) require.NoError(t, err) - expected := map[string]Measurements{ - "READ": { - Takes: 26 * time.Second, - Count: 50216, - OPS: 1934.6, - Avg: 246 * time.Microsecond, - Min: 138 * time.Microsecond, - Max: 9735 * time.Microsecond, - Perc50: 243 * time.Microsecond, - Perc90: 284 * time.Microsecond, - Perc95: 305 * time.Microsecond, - Perc99: 381 * time.Microsecond, - Perc999: 692 * time.Microsecond, - Perc9999: 2871 * time.Microsecond, + expected := map[string]map[string]float64{ + "read": { + "takes": 14.7, + "count": 25030, + "ops": 1705.6, + "avg": 0.000293, + "min": 0.000175, + "max": 0.002407, + "perc50": 0.000288, + "perc90": 0.000331, + "perc95": 0.000353, + "perc99": 0.000427, + "perc999": 0.000757, + "perc9999": 0.001312, }, - "TOTAL": { - Takes: 26 * time.Second, - Count: 100000, - OPS: 3852.6, - Avg: 257 * time.Microsecond, - Min: 138 * time.Microsecond, - Max: 52799 * time.Microsecond, - Perc50: 251 * time.Microsecond, - Perc90: 296 * time.Microsecond, - Perc95: 318 * time.Microsecond, - Perc99: 405 * time.Microsecond, - Perc999: 848 * time.Microsecond, - Perc9999: 2979 * time.Microsecond, + "update": { + "takes": 14.7, + "count": 24970, + "ops": 1701.4, + "avg": 0.000288, + "min": 0.000171, + "max": 0.002261, + "perc50": 0.000282, + "perc90": 0.000324, + "perc95": 0.000345, + "perc99": 0.000411, + "perc999": 0.000786, + "perc9999": 0.002151, }, - "UPDATE": { - Takes: 26 * time.Second, - Count: 49784, - OPS: 1918.0, - Avg: 267 * time.Microsecond, - Min: 153 * time.Microsecond, - Max: 52799 * time.Microsecond, - Perc50: 260 * time.Microsecond, - Perc90: 304 * time.Microsecond, - Perc95: 328 * time.Microsecond, - Perc99: 430 * time.Microsecond, - Perc999: 1684 * time.Microsecond, - Perc9999: 2979 * time.Microsecond, + "total": { + "takes": 14.7, + "count": 50000, + "ops": 3406.9, + "avg": 0.000291, + "min": 0.000171, + "max": 0.002407, + "perc50": 0.000285, + "perc90": 0.000328, + "perc95": 0.000349, + "perc99": 0.000421, + "perc999": 0.000777, + "perc9999": 0.001913, }, } + assert.Equal(t, expected, actual) } diff --git a/projects/_old/ycsb-workloada.yml b/projects/_old/ycsb-workloada.yml deleted file mode 100644 index b3358e1c9..000000000 --- a/projects/_old/ycsb-workloada.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Workload A: Update heavy workload -runner: ycsb -params: - dir: ycsb - args: - - workloads/workloada - - recordcount=5000 - -results: - postgresql: - stats: - pass: 1 - - sqlite: - stats: - pass: 1 - - mongodb: - stats: - pass: 1 diff --git a/projects/enmeshed-runtime b/projects/enmeshed-runtime index c1c9e0a9c..3f1efacb5 160000 --- a/projects/enmeshed-runtime +++ b/projects/enmeshed-runtime @@ -1 +1 @@ -Subproject commit c1c9e0a9cc9f319bc7c42f29bec1bc527ae2a05b +Subproject commit 3f1efacb599081dd14b02f568dbedf6cf15140fe diff --git a/projects/meteor b/projects/meteor index 3676caeb8..3748b0848 160000 --- a/projects/meteor +++ b/projects/meteor @@ -1 +1 @@ -Subproject commit 3676caeb84323134540d0c695450d1ff17260cef +Subproject commit 3748b0848863f4fdfc9ca7b673233846822ae7f1 diff --git a/projects/restheart b/projects/restheart index 65c68558a..c8e68e653 160000 --- a/projects/restheart +++ b/projects/restheart @@ -1 +1 @@ -Subproject commit 65c68558ab675db8938493b2615e1b5bb8102426 +Subproject commit c8e68e653d30355121bf5e017a7bb1e69c0f058f diff --git a/projects/ycsb-workloada.yml b/projects/ycsb-workloada.yml new file mode 100644 index 000000000..e96ac528d --- /dev/null +++ b/projects/ycsb-workloada.yml @@ -0,0 +1,33 @@ +--- +# Workload A: Update heavy workload +runner: ycsb +params: + dir: ycsb + args: + - workloads/workloada + - mongodb.url={{.MONGODB_URI}} + +results: + mongodb: + stats: + pass: 3 + + mongodb-secured: + stats: + pass: 3 + + ferretdb-postgresql: + stats: + pass: 3 + + ferretdb-sqlite-replset: + stats: + pass: 3 + + ferretdb-postgresql-secured: + stats: + pass: 3 + + ferretdb-sqlite-replset-secured: + stats: + pass: 3 diff --git a/projects/ycsb/workloads/workloada b/projects/ycsb/workloads/workloada index 94130308c..97edbec8d 100644 --- a/projects/ycsb/workloads/workloada +++ b/projects/ycsb/workloads/workloada @@ -1,3 +1,6 @@ +# https://github.com/pingcap/go-ycsb/blob/master/workloads/workloada +# See also https://github.com/pingcap/go-ycsb/issues/278 + # Copyright (c) 2010 Yahoo! Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/projects/ycsb/workloads/workloadb b/projects/ycsb/workloads/workloadb index 12e8632e4..cbd019765 100644 --- a/projects/ycsb/workloads/workloadb +++ b/projects/ycsb/workloads/workloadb @@ -1,3 +1,6 @@ +# https://github.com/pingcap/go-ycsb/blob/master/workloads/workloadb +# See also https://github.com/pingcap/go-ycsb/issues/278 + # Copyright (c) 2010 Yahoo! Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/projects/ycsb/workloads/workloadc b/projects/ycsb/workloads/workloadc index 1c540f87e..df1f7943e 100644 --- a/projects/ycsb/workloads/workloadc +++ b/projects/ycsb/workloads/workloadc @@ -1,3 +1,6 @@ +# https://github.com/pingcap/go-ycsb/blob/master/workloads/workloadc +# See also https://github.com/pingcap/go-ycsb/issues/278 + # Copyright (c) 2010 Yahoo! Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you diff --git a/projects/ycsb/workloads/workloadd b/projects/ycsb/workloads/workloadd deleted file mode 100644 index 1ebd5709f..000000000 --- a/projects/ycsb/workloads/workloadd +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2010 Yahoo! Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you -# may not use this file except in compliance with the License. You -# may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. See accompanying -# LICENSE file. - -# Yahoo! Cloud System Benchmark -# Workload D: Read latest workload -# Application example: user status updates; people want to read the latest -# -# Read/update/insert ratio: 95/0/5 -# Default data size: 1 KB records (10 fields, 100 bytes each, plus key) -# Request distribution: latest - -# The insert order for this is hashed, not ordered. The "latest" items may be -# scattered around the keyspace if they are keyed by userid.timestamp. A workload -# which orders items purely by time, and demands the latest, is very different than -# workload here (which we believe is more typical of how people build systems.) - -recordcount=1000 -operationcount=1000 -workload=core - -readallfields=true - -readproportion=0.95 -updateproportion=0 -scanproportion=0 -insertproportion=0.05 - -requestdistribution=latest diff --git a/projects/ycsb/workloads/workloade b/projects/ycsb/workloads/workloade deleted file mode 100644 index 93396d70c..000000000 --- a/projects/ycsb/workloads/workloade +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2010 Yahoo! Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you -# may not use this file except in compliance with the License. You -# may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. See accompanying -# LICENSE file. - -# Yahoo! Cloud System Benchmark -# Workload E: Short ranges -# Application example: threaded conversations, where each scan is for the posts in a given thread (assumed to be clustered by thread id) -# -# Scan/insert ratio: 95/5 -# Default data size: 1 KB records (10 fields, 100 bytes each, plus key) -# Request distribution: zipfian - -# The insert order is hashed, not ordered. Although the scans are ordered, it does not necessarily -# follow that the data is inserted in order. For example, posts for thread 342 may not be inserted contiguously, but -# instead interspersed with posts from lots of other threads. The way the YCSB client works is that it will pick a start -# key, and then request a number of records; this works fine even for hashed insertion. - -recordcount=1000 -operationcount=1000 -workload=core - -readallfields=true - -readproportion=0 -updateproportion=0 -scanproportion=0.95 -insertproportion=0.05 - -requestdistribution=uniform - -maxscanlength=1 - -scanlengthdistribution=uniform diff --git a/projects/ycsb/workloads/workloadf b/projects/ycsb/workloads/workloadf deleted file mode 100644 index 14dabb866..000000000 --- a/projects/ycsb/workloads/workloadf +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2010 Yahoo! Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you -# may not use this file except in compliance with the License. You -# may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. See accompanying -# LICENSE file. - -# Yahoo! Cloud System Benchmark -# Workload F: Read-modify-write workload -# Application example: user database, where user records are read and modified by the user or to record user activity. -# -# Read/read-modify-write ratio: 50/50 -# Default data size: 1 KB records (10 fields, 100 bytes each, plus key) -# Request distribution: zipfian - -recordcount=1000 -operationcount=1000 -workload=core - -readallfields=true - -readproportion=0.5 -updateproportion=0 -scanproportion=0 -insertproportion=0 -readmodifywriteproportion=0.5 - -requestdistribution=uniform From fb5731949ff53505e06041358e1e26305194103a Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 08:27:16 +0400 Subject: [PATCH 02/11] Tweak output --- cmd/dance/main.go | 12 ++++++-- internal/config/results.go | 57 +++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 4189bebe7..cf48c925f 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -59,7 +59,7 @@ func waitForPort(ctx context.Context, port int) error { return ctx.Err() } -func logResult(label string, res map[string]string) { +func logResult(label string, res map[string]config.TestResult) { keys := maps.Keys(res) if len(keys) == 0 { return @@ -68,8 +68,14 @@ func logResult(label string, res map[string]string) { log.Printf("%s tests:", label) sort.Strings(keys) for _, t := range keys { - out := res[t] - log.Printf("===> %s:\n\t%s\n\n", t, out) + log.Printf("===> %s:", t) + if o := res[t].Output; o != "" { + log.Printf("\t%s", o) + } + if m := res[t].Measurements; m != nil { + log.Printf("\tMeasurements: %v", m) + } + log.Printf("") } } diff --git a/internal/config/results.go b/internal/config/results.go index 7a69806c1..2c27f8cc8 100644 --- a/internal/config/results.go +++ b/internal/config/results.go @@ -39,16 +39,16 @@ func (tr *TestResult) IndentedOutput() string { // CompareResults represents the comparison between expected and actual test outcomes. type CompareResults struct { // expected - Failed map[string]string - Skipped map[string]string - Passed map[string]string + Failed map[string]TestResult + Skipped map[string]TestResult + Passed map[string]TestResult // unexpected - XFailed map[string]string - XSkipped map[string]string - XPassed map[string]string + XFailed map[string]TestResult + XSkipped map[string]TestResult + XPassed map[string]TestResult - Unknown map[string]string + Unknown map[string]TestResult Stats Stats } @@ -88,13 +88,13 @@ func (expected *ExpectedResults) mapStatuses() map[string]Status { // Compare compares expected and actual results. func (expected *ExpectedResults) Compare(actual map[string]TestResult) (*CompareResults, error) { res := &CompareResults{ - Failed: make(map[string]string), - Skipped: make(map[string]string), - Passed: make(map[string]string), - XFailed: make(map[string]string), - XSkipped: make(map[string]string), - XPassed: make(map[string]string), - Unknown: make(map[string]string), + Failed: make(map[string]TestResult), + Skipped: make(map[string]TestResult), + Passed: make(map[string]TestResult), + XFailed: make(map[string]TestResult), + XSkipped: make(map[string]TestResult), + XPassed: make(map[string]TestResult), + Unknown: make(map[string]TestResult), } tests := maps.Keys(actual) @@ -115,48 +115,53 @@ func (expected *ExpectedResults) Compare(actual map[string]TestResult) (*Compare } o := actualResult.IndentedOutput() + tr := TestResult{ + Status: actualResult.Status, + Output: o, + Measurements: actualResult.Measurements, + } switch expectedStatus { case Fail: switch actualResult.Status { case Fail: - res.Failed[test] = o + res.Failed[test] = tr case Skip: - res.XSkipped[test] = o + res.XSkipped[test] = tr case Pass: - res.XPassed[test] = o + res.XPassed[test] = tr case Ignore, Unknown: fallthrough default: - res.Unknown[test] = o + res.Unknown[test] = tr } case Skip: switch actualResult.Status { case Fail: - res.XFailed[test] = o + res.XFailed[test] = tr case Skip: - res.Skipped[test] = o + res.Skipped[test] = tr case Pass: - res.XPassed[test] = o + res.XPassed[test] = tr case Ignore, Unknown: fallthrough default: - res.Unknown[test] = o + res.Unknown[test] = tr } case Pass: switch actualResult.Status { case Fail: - res.XFailed[test] = o + res.XFailed[test] = tr case Skip: - res.XSkipped[test] = o + res.XSkipped[test] = tr case Pass: - res.Passed[test] = o + res.Passed[test] = tr case Ignore, Unknown: fallthrough default: - res.Unknown[test] = o + res.Unknown[test] = tr } case Ignore: From aa702716f15d84ce69638e121d8de058fce528a0 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 09:03:49 +0400 Subject: [PATCH 03/11] Accept URL --- cmd/dance/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dance/main.go b/cmd/dance/main.go index cf48c925f..6e2058ad4 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -81,9 +81,9 @@ func logResult(label string, res map[string]config.TestResult) { //nolint:vet // for readability var cli struct { - // TODO https://github.com/FerretDB/dance/issues/30 Database []string `help:"${help_database}" enum:"${enum_database}" short:"d"` Verbose bool `help:"Be more verbose." short:"v"` + Push *url.URL `help:"Push results to the given MongoDB URI."` Config []string `arg:"" help:"Project configurations to run." optional:"" type:"existingfile"` } From 15137d43484c1d2fe19e977a062f315095aed99d Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 09:42:17 +0400 Subject: [PATCH 04/11] Push results --- Taskfile.yaml | 3 +-- cmd/dance/main.go | 39 +++++++++++++++++++++++++++++++++++- internal/runner/ycsb/ycsb.go | 3 +-- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 3bf1e4ef1..36d93ef7d 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -4,7 +4,6 @@ version: "3" vars: DB: "" CONFIG: "" - FLAGS: "" RACE_FLAG: -race={{and (ne OS "windows") (ne ARCH "arm") (ne ARCH "riscv64")}} tasks: @@ -83,7 +82,7 @@ tasks: deps: [build] dir: projects cmds: - - ../bin/dance {{.FLAGS}} --database={{.DB}} {{.CONFIG}} + - ../bin/dance --database={{.DB}} {{.CONFIG}} lint: desc: "Run linters" diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 6e2058ad4..4d7cdff49 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -32,6 +32,9 @@ import ( "github.com/alecthomas/kong" "github.com/pmezard/go-difflib/difflib" "github.com/sethvargo/go-githubactions" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" "golang.org/x/exp/maps" "gopkg.in/yaml.v3" @@ -149,6 +152,16 @@ func main() { } } + var mongoClient *mongo.Client + if cli.Push != nil { + var err error + if mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(cli.Push.String())); err != nil { + log.Fatalf("Failed to connect to MongoDB URI to push results: %s", err) + } + + defer mongoClient.Disconnect(ctx) + } + if len(cli.Config) == 0 { var err error if cli.Config, err = filepath.Glob("*.yml"); err != nil { @@ -171,7 +184,7 @@ func main() { log.Fatal(err) } - rl := l.With(slog.String("config", cf), slog.String("db", db)) + rl := l.With(slog.String("config", cf), slog.String("database", db)) var runner runner.Runner @@ -260,6 +273,30 @@ func main() { action := githubactions.New() action.Noticef("%s", msg) } + + if mongoClient != nil { + hostname, _ := os.Hostname() + + var passed bson.D + for t, tr := range cmp.Passed { + passed = append(passed, bson.E{t, bson.D{{"m", tr.Measurements}}}) + } + + doc := bson.D{ + {"config", cf}, + {"database", db}, + {"time", time.Now()}, + {"env", bson.D{ + {"runner", os.Getenv("RUNNER_NAME")}, + {"hostname", hostname}, + }}, + {"passed", passed}, + } + + if _, err = mongoClient.Database("dance").Collection("incoming").InsertOne(ctx, doc); err != nil { + log.Fatal(err) + } + } } } } diff --git a/internal/runner/ycsb/ycsb.go b/internal/runner/ycsb/ycsb.go index 5cb67d692..c26edb305 100644 --- a/internal/runner/ycsb/ycsb.go +++ b/internal/runner/ycsb/ycsb.go @@ -24,7 +24,6 @@ import ( "log/slog" "os" "os/exec" - "path" "path/filepath" "strings" "time" @@ -140,7 +139,7 @@ func run(ctx context.Context, args []string, dir string) (map[string]config.Test res := make(map[string]config.TestResult) for t, m := range ms { - res[path.Join(dir, t)] = config.TestResult{ + res[t] = config.TestResult{ Status: config.Pass, Measurements: m, } From c94c9cc63ee57fbb0eaabccd16dd14358413e087 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 09:47:59 +0400 Subject: [PATCH 05/11] Lint --- .golangci-new.yml | 9 ++++----- .golangci.yml | 9 +++++++++ cmd/dance/main.go | 7 +++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.golangci-new.yml b/.golangci-new.yml index acc782f48..7a8aebb17 100644 --- a/.golangci-new.yml +++ b/.golangci-new.yml @@ -12,11 +12,6 @@ linters-settings: ignore-test: false copyloopvar: check-alias: true - errcheck: - check-type-assertions: false - check-blank: false - disable-default-exclusions: false - exclude-functions: [] errorlint: # see caveats at https://github.com/polyfloyd/go-errorlint#fmterrorf-wrapping-verb errorf: false @@ -66,6 +61,7 @@ linters: # checked by the other configuration - asciicheck - depguard + - errcheck - exhaustive - forbidigo - gci @@ -177,3 +173,6 @@ issues: # whole-files: true exclude-use-default: false + exclude-rules: + - linters: [govet] + text: "composites: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields" diff --git a/.golangci.yml b/.golangci.yml index 9d2c7e154..3c6b2aa0a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,6 +18,14 @@ linters-settings: desc: use `slices` package instead - pkg: maps desc: use `golang.org/x/exp/maps` package instead + errcheck: + check-type-assertions: false + check-blank: false + disable-default-exclusions: false + exclude-functions: + - (*go.mongodb.org/mongo-driver/mongo.Client).Disconnect + - (*go.mongodb.org/mongo-driver/mongo.Cursor).Close + - (io.ReadCloser).Close exhaustive: default-signifies-exhaustive: false forbidigo: @@ -120,6 +128,7 @@ linters: enable: - asciicheck - depguard + - errcheck - exhaustive - forbidigo - gci diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 4d7cdff49..00fe35034 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -50,8 +50,7 @@ func waitForPort(ctx context.Context, port int) error { for ctx.Err() == nil { conn, err := net.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port)) if err == nil { - conn.Close() - return nil + return conn.Close() } sleepCtx, sleepCancel := context.WithTimeout(ctx, time.Second) @@ -72,12 +71,15 @@ func logResult(label string, res map[string]config.TestResult) { sort.Strings(keys) for _, t := range keys { log.Printf("===> %s:", t) + if o := res[t].Output; o != "" { log.Printf("\t%s", o) } + if m := res[t].Measurements; m != nil { log.Printf("\tMeasurements: %v", m) } + log.Printf("") } } @@ -153,6 +155,7 @@ func main() { } var mongoClient *mongo.Client + if cli.Push != nil { var err error if mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(cli.Push.String())); err != nil { From e2543873997daefa68052e85b61f29d94d68cac4 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 09:51:58 +0400 Subject: [PATCH 06/11] CI --- .github/workflows/dance.yml | 10 +++++----- cmd/dance/main.go | 2 ++ projects/ycsb-workloadb.yml | 33 +++++++++++++++++++++++++++++++++ projects/ycsb-workloadc.yml | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 projects/ycsb-workloadb.yml create mode 100644 projects/ycsb-workloadc.yml diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index ffb3974f7..448172ddd 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -59,11 +59,9 @@ jobs: - mongo-tools - # - restheart - # - restheart-auth - - # - ycsb-workloada - # - ycsb-workloadc + - ycsb-workloada + - ycsb-workloadb + - ycsb-workloadc steps: - name: Checkout code @@ -91,6 +89,8 @@ jobs: - name: Dance! run: bin/task dance CONFIG=${{ matrix.project }}.yml + env: + DANCE_PUSH: ${{ secrets.NMSHD_TEST_BASEURL }} - name: Collect logs if: failure() diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 00fe35034..9a7d0ad6b 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -157,6 +157,8 @@ func main() { var mongoClient *mongo.Client if cli.Push != nil { + log.Printf("Connecting to push data...") + var err error if mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(cli.Push.String())); err != nil { log.Fatalf("Failed to connect to MongoDB URI to push results: %s", err) diff --git a/projects/ycsb-workloadb.yml b/projects/ycsb-workloadb.yml new file mode 100644 index 000000000..a2c7b775b --- /dev/null +++ b/projects/ycsb-workloadb.yml @@ -0,0 +1,33 @@ +--- +# Workload B: Read mostly workload +runner: ycsb +params: + dir: ycsb + args: + - workloads/workloadb + - mongodb.url={{.MONGODB_URI}} + +results: + mongodb: + stats: + pass: 3 + + mongodb-secured: + stats: + pass: 3 + + ferretdb-postgresql: + stats: + pass: 3 + + ferretdb-sqlite-replset: + stats: + pass: 3 + + ferretdb-postgresql-secured: + stats: + pass: 3 + + ferretdb-sqlite-replset-secured: + stats: + pass: 3 diff --git a/projects/ycsb-workloadc.yml b/projects/ycsb-workloadc.yml new file mode 100644 index 000000000..20faed4dc --- /dev/null +++ b/projects/ycsb-workloadc.yml @@ -0,0 +1,33 @@ +--- +# Workload C: Read only +runner: ycsb +params: + dir: ycsb + args: + - workloads/workloadc + - mongodb.url={{.MONGODB_URI}} + +results: + mongodb: + stats: + pass: 3 + + mongodb-secured: + stats: + pass: 3 + + ferretdb-postgresql: + stats: + pass: 3 + + ferretdb-sqlite-replset: + stats: + pass: 3 + + ferretdb-postgresql-secured: + stats: + pass: 3 + + ferretdb-sqlite-replset-secured: + stats: + pass: 3 From 371da30aa5d4be4c67f55baba9f20c7942645077 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 10:03:51 +0400 Subject: [PATCH 07/11] Connect to Tailscale --- .github/workflows/dance.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index 448172ddd..d2ee19533 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -84,13 +84,21 @@ jobs: FERRETDB_IMAGE: ${{ inputs.ferretdb_image || 'ghcr.io/ferretdb/ferretdb-dev:main' }} POSTGRES_IMAGE: ${{ inputs.postgres_image || 'postgres:16.4' }} + - name: Connect to Tailscale + if: github.event_name != 'pull_request' + uses: tailscale/github-action@v2 + with: + oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }} + oauth-secret: ${{ secrets.TAILSCALE_SECRET }} + tags: tag:ci + - name: Run init run: bin/task init - name: Dance! run: bin/task dance CONFIG=${{ matrix.project }}.yml env: - DANCE_PUSH: ${{ secrets.NMSHD_TEST_BASEURL }} + DANCE_PUSH: ${{ secrets.DANCE_PUSH }} - name: Collect logs if: failure() From 5cdedacfc6daf54f2c6bdd4aefe6c06635019a1e Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 10:18:47 +0400 Subject: [PATCH 08/11] Debug --- cmd/dance/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 9a7d0ad6b..eaef0e75c 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -157,7 +157,7 @@ func main() { var mongoClient *mongo.Client if cli.Push != nil { - log.Printf("Connecting to push data...") + log.Printf("Connecting to %+v to push data...", cli.Push) var err error if mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(cli.Push.String())); err != nil { From efdedf0d6e76bd0b9ecdb1edeb8aa09d9a83670e Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 10:25:29 +0400 Subject: [PATCH 09/11] Fix --- cmd/dance/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/dance/main.go b/cmd/dance/main.go index eaef0e75c..369ca5ab1 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -88,7 +88,7 @@ func logResult(label string, res map[string]config.TestResult) { var cli struct { Database []string `help:"${help_database}" enum:"${enum_database}" short:"d"` Verbose bool `help:"Be more verbose." short:"v"` - Push *url.URL `help:"Push results to the given MongoDB URI."` + Push string `help:"Push results to the given MongoDB URI."` Config []string `arg:"" help:"Project configurations to run." optional:"" type:"existingfile"` } @@ -156,11 +156,11 @@ func main() { var mongoClient *mongo.Client - if cli.Push != nil { + if cli.Push != "" { log.Printf("Connecting to %+v to push data...", cli.Push) var err error - if mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(cli.Push.String())); err != nil { + if mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(cli.Push)); err != nil { log.Fatalf("Failed to connect to MongoDB URI to push results: %s", err) } From f108ca7a272989610a4ccaa2a92ae70c1a6b0aa8 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 10:30:03 +0400 Subject: [PATCH 10/11] Remove another old file --- projects/_old/ycsb-workloadc.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 projects/_old/ycsb-workloadc.yml diff --git a/projects/_old/ycsb-workloadc.yml b/projects/_old/ycsb-workloadc.yml deleted file mode 100644 index fc06e12b3..000000000 --- a/projects/_old/ycsb-workloadc.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Workload C: Read only -runner: ycsb -params: - dir: ycsb - args: - - workloads/workloadc - - recordcount=5000 - -results: - postgresql: - stats: - pass: 1 - - sqlite: - stats: - pass: 1 - - mongodb: - stats: - pass: 1 From c595b5ebe52c9a1a5b263de400dfd3d50f0b90fd Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 10:31:39 +0400 Subject: [PATCH 11/11] Fix configuration --- projects/ycsb-workloadc.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/ycsb-workloadc.yml b/projects/ycsb-workloadc.yml index 20faed4dc..dc89f22ec 100644 --- a/projects/ycsb-workloadc.yml +++ b/projects/ycsb-workloadc.yml @@ -10,24 +10,24 @@ params: results: mongodb: stats: - pass: 3 + pass: 2 mongodb-secured: stats: - pass: 3 + pass: 2 ferretdb-postgresql: stats: - pass: 3 + pass: 2 ferretdb-sqlite-replset: stats: - pass: 3 + pass: 2 ferretdb-postgresql-secured: stats: - pass: 3 + pass: 2 ferretdb-sqlite-replset-secured: stats: - pass: 3 + pass: 2