Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.17
go-version: 1.22

- name: Build
run: go build -v ./...
Expand Down
32 changes: 1 addition & 31 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is part of MinIO dperf
// Copyright (c) 2021 MinIO, Inc.
// Copyright (c) 2021-2024 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
Expand All @@ -22,12 +22,9 @@ import (
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"syscall"

"github.com/dustin/go-humanize"
"github.com/lrita/numa"
"github.com/spf13/cobra"
"github.com/spf13/viper"

Expand Down Expand Up @@ -73,31 +70,6 @@ $ dperf /mnt/drive{1..6}
$ dperf --serial /mnt/drive{1..6}
`,
RunE: func(c *cobra.Command, args []string) error {
if cpuNode > -1 {
cpumask, err := numa.NodeToCPUMask(cpuNode)
if err != nil {
return err
}

if err = numa.SetSchedAffinity(0, cpumask); err != nil {
return err
}

if v := os.Getenv("_DPERF_AVOID_RESPAWN"); v == "" {
// Use the original binary location. This works with symlinks such that if
// the file it points to has been changed we will use the updated symlink.
argv0, err := exec.LookPath(os.Args[0])
if err != nil {
return err
}

// Invokes the execve system call.
// Re-uses the same pid. This preserves the pid over multiple server-respawns.
os.Setenv("_DPERF_AVOID_RESPAWN", "1")
return syscall.Exec(argv0, os.Args, os.Environ())
}
}

bs, err := humanize.ParseBytes(blockSize)
if err != nil {
return fmt.Errorf("Invalid blocksize format: %v", err)
Expand Down Expand Up @@ -179,8 +151,6 @@ func init() {
"blocksize", "b", blockSize, "read/write block size")
dperfCmd.PersistentFlags().StringVarP(&fileSize,
"filesize", "f", fileSize, "amount of data to read/write per drive")
dperfCmd.PersistentFlags().IntVarP(&cpuNode,
"cpunode", "c", -1, "execute on a specific CPU node, defaults to all CPU nodes")
dperfCmd.PersistentFlags().IntVarP(&ioPerDrive,
"ioperdrive", "i", ioPerDrive, "number of concurrent I/O per drive, default is 4")

Expand Down
41 changes: 20 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
module github.com/minio/dperf

go 1.17
go 1.22

require (
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.15.0
github.com/google/uuid v1.3.0
github.com/lrita/numa v1.0.2
github.com/minio/pkg/v2 v2.0.4
github.com/fatih/color v1.17.0
github.com/google/uuid v1.6.0
github.com/minio/pkg/v3 v3.0.15
github.com/ncw/directio v1.0.5
github.com/secure-io/sio-go v0.3.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
golang.org/x/sys v0.9.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
golang.org/x/sys v0.25.0
)

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/intel-go/cpuid v0.0.0-20220614022739-219e067757cb // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/rogpeppe/go-internal v1.9.1-0.20221123163938-fef05454be76 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/text v0.10.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/text v0.18.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading