Skip to content

Add --tls flags #39

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 15 additions & 4 deletions redis-bechmark-go.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ package main

import (
"context"
tls "crypto/tls"
"flag"
"fmt"
hdrhistogram "github.com/HdrHistogram/hdrhistogram-go"
radix "github.com/mediocregopher/radix/v4"
"github.com/redis/rueidis"
"golang.org/x/time/rate"
"log"
"math/rand"
"net"
Expand All @@ -16,6 +13,11 @@ import (
"strings"
"sync"
"time"

hdrhistogram "github.com/HdrHistogram/hdrhistogram-go"
radix "github.com/mediocregopher/radix/v4"
"github.com/redis/rueidis"
"golang.org/x/time/rate"
)

func benchmarkRoutine(radixClient Client, ruedisClient rueidis.Client, useRuedis, useCSC, enableMultiExec bool, datapointsChan chan datapoint, continueOnError bool, cmdS [][]string, commandsCDF []float32, keyspacelen, datasize, number_samples uint64, loop bool, debug_level int, wg *sync.WaitGroup, keyplace, dataplace []int, readOnly []bool, useLimiter bool, rateLimiter *rate.Limiter, waitReplicas, waitReplicasMs int, cacheOptions *rueidis.CacheOptions) {
Expand Down Expand Up @@ -182,6 +184,7 @@ func main() {
rpsburst := flag.Int64("rps-burst", 0, "Max rps burst. If 0 the allowed burst will be the ammount of clients.")
username := flag.String("u", "", "Username for Redis Auth.")
password := flag.String("a", "", "Password for Redis Auth.")
enableTls := flag.Bool("tls", false, "Use TLS connection.")
jsonOutFile := flag.String("json-out-file", "", "Results file. If empty will not save.")
seed := flag.Int64("random-seed", 12345, "random seed to be used.")
clients := flag.Uint64("c", 50, "number of clients.")
Expand Down Expand Up @@ -288,6 +291,14 @@ func main() {
opts.Protocol = "3"
alwaysRESP2 = false
}
if *enableTls {
opts.NetDialer = &tls.Dialer{
NetDialer: nil,
Config: &tls.Config{
ServerName: *host,
},
}
}

ips := make([]net.IP, 0)
if *nameserver != "" {
Expand Down