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
17 changes: 12 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
permissions:
id-token: write # To sign.
contents: write # To upload release assets.
actions: read # To read workflow path.
strategy:
fail-fast: false
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1.28
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
binary_name: "./bin/ftsb_redisearch"
binary_name: "ftsb_redisearch"
sha256sum: true
asset_name: ftsb_redisearch-${{ matrix.goos }}-${{ matrix.goarch }}
build_command: "make ftsb_redisearch"
asset_name: ftsb_redisearch_${{ matrix.goos }}_${{ matrix.goarch }}
build_command: "make build"
retry: 5
overwrite: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FTSB outputs #
################

ftsb_redisearch
cmd/ftsb_redisearch/ftsb_redisearch

###################
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ GIT_DIRTY:=$(shell git diff --no-ext-diff 2> /dev/null | wc -l)
endif

LDFLAGS = "-X 'main.GitSHA1=$(GIT_SHA)' -X 'main.GitDirty=$(GIT_DIRTY)'"
OS_ARCHs = "linux/amd64 linux/arm64 linux/arm windows/amd64 darwin/amd64 darwin/arm"

build:
$(GOBUILD) \
-ldflags=$(LDFLAGS) ./cmd/ftsb_redisearch
fmt:
$(GOFMT) ./...

Expand All @@ -41,13 +45,13 @@ test: get
release:
$(GOGET) github.com/mitchellh/gox
$(GOGET) github.com/tcnksm/ghr
GO111MODULE=on gox -osarch "linux/amd64 darwin/amd64" \
-ldflags=$(LDFLAGS) \
-output "${DISTDIR}/${BIN_NAME}_{{.OS}}_{{.Arch}}" ./cmd/ftsb_redisearch
GO111MODULE=on gox -osarch ${OS_ARCHs} \
-ldflags="-X 'main.GitSHA1=$(GIT_SHA)' -X 'main.GitDirty=$(GIT_DIRTY)'" \
-output "${DISTDIR}/${BIN_NAME}_{{.OS}}_{{.Arch}}" ./cmd/ftsb_redisearch

publish: release
publish:
@for f in $(shell ls ${DISTDIR}); \
do \
echo "copying ${DISTDIR}/$${f}"; \
aws s3 cp ${DISTDIR}/$${f} s3://benchmarks.redislabs/${MODULE}/tools/${BIN_NAME}/$${f} --acl public-read; \
aws s3 cp ${DISTDIR}/$${f} s3://benchmarks.redislabs/redisearch/tools/ftsb/$${f} --acl public-read; \
done
18 changes: 8 additions & 10 deletions benchmark_runner/benchmark_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"flag"
"fmt"
"golang.org/x/time/rate"
"io/ioutil"
"log"
"math"
Expand All @@ -17,6 +16,8 @@ import (
"text/tabwriter"
"time"

"golang.org/x/time/rate"

"code.cloudfoundry.org/bytefmt"
hdrhistogram "github.com/HdrHistogram/hdrhistogram-go"
)
Expand All @@ -37,20 +38,21 @@ const (
// BenchmarkRunner is responsible for initializing and storing common
// flags across all database systems and ultimately running a supplied Benchmark
type BenchmarkRunner struct {
// flag fields
txTotalBytes uint64
rxTotalBytes uint64
maxRPS uint64
limit uint64

JsonOutFile string
Metadata string
batchSize uint
workers uint
maxRPS uint64
limit uint64
doLoad bool
reportingPeriod time.Duration
fileName string
start time.Time
end time.Time

// non-flag fields
br *bufio.Reader
detailedMapHistogramsMutex sync.RWMutex
detailedMapHistograms map[string]*hdrhistogram.Histogram
Expand All @@ -63,8 +65,7 @@ type BenchmarkRunner struct {

writeHistogram *hdrhistogram.Histogram
inst_writeHistogram *hdrhistogram.Histogram

writeTs []DataPoint
writeTs []DataPoint

updateHistogram *hdrhistogram.Histogram
inst_updateHistogram *hdrhistogram.Histogram
Expand All @@ -86,9 +87,6 @@ type BenchmarkRunner struct {
inst_totalHistogram *hdrhistogram.Histogram
totalTs []DataPoint

txTotalBytes uint64
rxTotalBytes uint64

testResult TestResult
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/ftsb_redisearch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
flag.StringVar(&host, "host", "localhost:6379", "The host:port for Redis connection")
flag.StringVar(&password, "a", "", "Password for Redis Auth.")
flag.IntVar(&debug, "debug", 0, "Debug printing (choices: 0, 1, 2). (default 0)")
flag.BoolVar(&continueOnErr, "continue-on-error", false, "If set to true, it will continue the benchmark and print the error message to stderr.")
flag.BoolVar(&continueOnErr, "continue-on-error", true, "If set to true, it will continue the benchmark and print the error message to stderr.")
flag.BoolVar(&clusterMode, "cluster-mode", false, "If set to true, it will run the client in cluster mode.")
flag.IntVar(&pipeline, "pipeline", 1, "Pipeline <numreq> requests. Default 1 (no pipeline).")
var timeoutSeconds int
Expand Down
77 changes: 70 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,80 @@
module github.com/RediSearch/ftsb

go 1.13
go 1.23

toolchain go1.24.1

require (
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
github.com/HdrHistogram/hdrhistogram-go v1.1.2
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/HdrHistogram/hdrhistogram-go v1.0.1
github.com/mediocregopher/radix/v3 v3.8.1
github.com/onsi/ginkgo v1.13.0 // indirect
golang.org/x/net v0.0.0-20220923203811-8be639271d50 // indirect
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
)

require (
cloud.google.com/go/compute/metadata v0.3.0 // indirect
github.com/Songmu/retry v0.1.0 // indirect
github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/creack/pty v1.1.9 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-github/v66 v66.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/pty v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/gox v1.0.1 // indirect
github.com/mitchellh/iochan v1.0.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/onsi/ginkgo/v2 v2.13.0 // indirect
github.com/onsi/gomega v1.28.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sclevine/agouti v3.0.0+incompatible // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.1.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/tcnksm/ghr v0.17.0 // indirect
github.com/tcnksm/go-gitconfig v0.1.2 // indirect
github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect
github.com/thediveo/enumflag/v2 v2.0.5 // indirect
github.com/thediveo/success v1.0.1 // indirect
github.com/yuin/goldmark v1.4.13 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/tools v0.26.0 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading