Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace random input generator #357

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"time"

"github.com/klauspost/compress/zstd"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/aggregate"
"github.com/minio/warp/pkg/bench"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/klauspost/compress/zstd"
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/api"
"github.com/minio/warp/pkg/aggregate"
"github.com/minio/warp/pkg/bench"
Expand Down
2 changes: 1 addition & 1 deletion cli/benchclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"time"

"github.com/minio/cli"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
"github.com/minio/websocket"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/minio/cli"
"github.com/minio/madmin-go/v3"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/api"
"github.com/minio/warp/pkg/bench"
)
Expand Down
7 changes: 3 additions & 4 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"github.com/cheggaaa/pb"
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v2/trie"
"github.com/minio/pkg/v2/words"
"github.com/minio/pkg/v3/console"
"github.com/minio/pkg/v3/trie"
"github.com/minio/pkg/v3/words"
"github.com/minio/warp/pkg"
completeinstall "github.com/posener/complete/cmd/install"
)
Expand Down Expand Up @@ -91,7 +91,6 @@ func init() {
deleteCmd,
listCmd,
statCmd,
selectCmd,
versionedCmd,
retentionCmd,
multipartCmd,
Expand Down
6 changes: 3 additions & 3 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import (
md5simd "github.com/minio/md5-simd"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/minio/pkg/v2/certs"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v2/ellipses"
"github.com/minio/pkg/v3/certs"
"github.com/minio/pkg/v3/console"
"github.com/minio/pkg/v3/ellipses"
"github.com/minio/warp/pkg"
"golang.org/x/net/http2"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/clientmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
)

var clientFlags = []cli.Flag{}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/klauspost/compress/zstd"
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cli

import (
"github.com/minio/cli"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/fanout.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cli

import (
"github.com/minio/cli"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
"github.com/minio/warp/pkg/generator"

Expand Down
22 changes: 0 additions & 22 deletions cli/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,6 @@ var genFlags = []cli.Flag{
},
}

func newGenSourceCSV(ctx *cli.Context) func() generator.Source {
prefixSize := 8
if ctx.Bool("noprefix") {
prefixSize = 0
}

g := generator.WithCSV().Size(25, 1000)

size, err := toSize(ctx.String("obj.size"))
fatalIf(probe.NewError(err), "Invalid obj.size specified")
src, err := generator.NewFn(g.Apply(),
generator.WithCustomPrefix(ctx.String("prefix")),
generator.WithPrefixSize(prefixSize),
generator.WithSize(int64(size)),
generator.WithRandomSize(ctx.Bool("obj.randsize")),
)
fatalIf(probe.NewError(err), "Unable to create data generator")
return src
}

// newGenSource returns a new generator
func newGenSource(ctx *cli.Context, sizeField string) func() generator.Source {
prefixSize := 8
Expand All @@ -74,8 +54,6 @@ func newGenSource(ctx *cli.Context, sizeField string) func() generator.Source {
switch ctx.String("obj.generator") {
case "random":
g = generator.WithRandomData()
case "csv":
g = generator.WithCSV().Size(25, 1000)
default:
err := errors.New("unknown generator type:" + ctx.String("obj.generator"))
fatal(probe.NewError(err), "Invalid -generator parameter")
Expand Down
2 changes: 1 addition & 1 deletion cli/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package cli
import (
"github.com/minio/cli"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cli

import (
"github.com/minio/cli"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/klauspost/compress/zstd"
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/mixed.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/minio/cli"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/cheggaaa/pb"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
)

// causeMessage container for golang error messages
Expand Down
2 changes: 1 addition & 1 deletion cli/progress-bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/cheggaaa/pb"
"github.com/fatih/color"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
)

// progress extender.
Expand Down
2 changes: 1 addition & 1 deletion cli/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/minio/cli"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/retention.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package cli

import (
"github.com/minio/cli"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/rlimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package cli
import (
"runtime/debug"

"github.com/minio/pkg/v2/sys"
"github.com/minio/pkg/v3/sys"
)

func setMaxResources() (err error) {
Expand Down
100 changes: 0 additions & 100 deletions cli/select.go

This file was deleted.

2 changes: 1 addition & 1 deletion cli/snowball.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package cli
import (
"github.com/minio/cli"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package cli
import (
"github.com/minio/cli"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio-go/v7"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"

"github.com/minio/cli"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v3/console"
"github.com/minio/warp/pkg/bench"
)

Expand Down
Loading
Loading