Skip to content

Commit 78e520b

Browse files
Merge pull request #11 from filipecosta90/release.improvement
Simplified release process gh actions
2 parents e53b595 + 062e387 commit 78e520b

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ on:
66

77
jobs:
88
publish:
9-
strategy:
10-
matrix:
11-
go-version: [ 1.16.x ]
12-
os: [ ubuntu-latest ]
13-
runs-on: ${{ matrix.os }}
9+
runs-on: ubuntu-latest
1410
steps:
1511
- uses: actions/checkout@master
1612
with:
1713
fetch-depth: 1
1814
- name: Install Go
1915
uses: actions/setup-go@v2
2016
with:
21-
go-version: ${{ matrix.go-version }}
17+
go-version: 1.16.x
2218
- name: Make Release
2319
run: make release
2420
- name: Upload release binaries

bin_info.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ import (
99
var GitSHA1 string = ""
1010
var GitDirty string = "0"
1111

12+
// internal function to return value of GitSHA1 var, which is filled in link time
1213
func toolGitSHA1() string {
1314
return GitSHA1
1415
}
1516

17+
// this internal function will check for the number of altered lines that are not yet committed
18+
// and return true in that case
1619
func toolGitDirty() (dirty bool) {
1720
dirty = false
1821
dirtyLines, err := strconv.Atoi(strings.TrimSpace(GitDirty))

redis-bechmark-go.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"log"
1010
"math"
1111
"math/rand"
12+
"net"
1213
"os"
1314
"os/signal"
1415
"sync"
@@ -171,7 +172,8 @@ func main() {
171172
if *password != "" {
172173
opts = append(opts, radix.DialAuthPass(*password))
173174
}
174-
connectionStr := fmt.Sprintf("%s:%d", *host, *port)
175+
ips, _ := net.LookupIP(*host)
176+
175177
stopChan := make(chan struct{})
176178
// a WaitGroup for the goroutines to tell us they've stopped
177179
wg := sync.WaitGroup{}
@@ -183,15 +185,15 @@ func main() {
183185
fmt.Printf("Using random seed: %d\n", *seed)
184186
rand.Seed(*seed)
185187
var cluster *radix.Cluster
186-
var standalone *radix.Pool
187-
if *clusterMode {
188-
cluster = getOSSClusterConn(connectionStr, opts, *clients)
189-
} else {
190-
standalone = getStandaloneConn(connectionStr, opts, *clients)
191-
}
188+
192189
datapointsChan := make(chan datapoint, *numberRequests)
193190
for channel_id := 1; uint64(channel_id) <= *clients; channel_id++ {
194191
wg.Add(1)
192+
connectionStr := fmt.Sprintf("%s:%d", ips[rand.Int63n(int64(len(ips)))], *port)
193+
if *clusterMode {
194+
cluster = getOSSClusterConn(connectionStr, opts, *clients)
195+
}
196+
fmt.Printf("Using connection string %s for client %d\n", connectionStr, channel_id)
195197
cmd := make([]string, len(args))
196198
copy(cmd, args)
197199
if *clusterMode {
@@ -200,7 +202,8 @@ func main() {
200202
if *multi {
201203
go ingestionRoutine(getStandaloneConn(connectionStr, opts, 1), *multi, datapointsChan, true, cmd, *keyspacelen, *datasize, samplesPerClient, *loop, int(*debug), &wg, keyPlaceOlderPos, dataPlaceOlderPos, useRateLimiter, rateLimiter)
202204
} else {
203-
go ingestionRoutine(standalone, *multi, datapointsChan, true, cmd, *keyspacelen, *datasize, samplesPerClient, *loop, int(*debug), &wg, keyPlaceOlderPos, dataPlaceOlderPos, useRateLimiter, rateLimiter)
205+
go ingestionRoutine(getStandaloneConn(connectionStr, opts, 1), *multi, datapointsChan, true, cmd, *keyspacelen, *datasize, samplesPerClient, *loop, int(*debug), &wg, keyPlaceOlderPos, dataPlaceOlderPos, useRateLimiter, rateLimiter)
206+
time.Sleep(time.Millisecond * 10)
204207
}
205208
}
206209
}
@@ -212,6 +215,7 @@ func main() {
212215
tick := time.NewTicker(time.Duration(client_update_tick) * time.Second)
213216
closed, _, duration, totalMessages, _ := updateCLI(tick, c, *numberRequests, *loop, datapointsChan)
214217
messageRate := float64(totalMessages) / float64(duration.Seconds())
218+
avgMs := float64(latencies.Mean()) / 1000.0
215219
p50IngestionMs := float64(latencies.ValueAtQuantile(50.0)) / 1000.0
216220
p95IngestionMs := float64(latencies.ValueAtQuantile(95.0)) / 1000.0
217221
p99IngestionMs := float64(latencies.ValueAtQuantile(99.0)) / 1000.0
@@ -222,8 +226,8 @@ func main() {
222226
fmt.Printf("Total Errors %d\n", totalErrors)
223227
fmt.Printf("Throughput summary: %.0f requests per second\n", messageRate)
224228
fmt.Printf("Latency summary (msec):\n")
225-
fmt.Printf(" %9s %9s %9s\n", "p50", "p95", "p99")
226-
fmt.Printf(" %9.3f %9.3f %9.3f\n", p50IngestionMs, p95IngestionMs, p99IngestionMs)
229+
fmt.Printf(" %9s %9s %9s %9s\n", "avg", "p50", "p95", "p99")
230+
fmt.Printf(" %9.3f %9.3f %9.3f %9.3f\n", avgMs, p50IngestionMs, p95IngestionMs, p99IngestionMs)
227231

228232
if closed {
229233
return

0 commit comments

Comments
 (0)