diff --git a/pkg/cmd/drt-run/config/drt-chaos.yaml b/pkg/cmd/drt-run/config/drt-chaos.yaml index 0f6a35ecd753..35f4ea144ad3 100644 --- a/pkg/cmd/drt-run/config/drt-chaos.yaml +++ b/pkg/cmd/drt-run/config/drt-chaos.yaml @@ -4,36 +4,36 @@ workloads: steps: - command: run args: - - --warehouses 12000 - - --active-warehouses 1700 - - --db cct_tpcc + - --warehouses=12000 + - --active-warehouses=1700 + - --db=cct_tpcc - --secure - - --ramp 10m - - --display-every 5s - - --duration 12h - - --prometheus-port 2112 - - --user cct_tpcc_user + - --ramp=10m + - --display-every=5s + - --duration=12h + - --prometheus-port=2112 + - --user=cct_tpcc_user - --tolerate-errors - - --password tpcc + - --password=tpcc - name: kv-main kind: kv steps: - command: run args: - - --concurrency 8 - - --histograms kv/stats.json - - --db kv - - --splits 500 - - --read-percent 50 - - --cycle-length 100000 - - --min-block-bytes 100 - - --max-block-bytes 1000 - - --max-rate 120 + - --concurrency=8 + - --histograms=kv/stats.json + - --db=kv + - --splits=500 + - --read-percent=50 + - --cycle-length=100000 + - --min-block-bytes=100 + - --max-block-bytes=1000 + - --max-rate=120 - --secure - - --prometheus-port 2114 - - --ramp 10m - - --display-every 5s - - --duration 12h + - --prometheus-port=2114 + - --ramp=10m + - --display-every=5s + - --duration=12h - --tolerate-errors - --enum operations: diff --git a/pkg/cmd/drt-run/event.go b/pkg/cmd/drt-run/event.go index c80346edfd7c..e2f4fec7ea4a 100644 --- a/pkg/cmd/drt-run/event.go +++ b/pkg/cmd/drt-run/event.go @@ -119,16 +119,18 @@ func (l *eventLogger) logWorkloadEvent(ev Event, workloadIdx int) { ev.Source = SourceWorkload we := &l.workloadEvents[workloadIdx] - we.mu.Lock() - idx := we.mu.startIdx - we.mu.startIdx = (we.mu.startIdx + 1) % perWorkloadEventRetention - if we.mu.numEvents != len(we.events) { - we.mu.numEvents++ - } - we.mu.Unlock() - + var idx int + func() { + we.mu.Lock() + defer we.mu.Unlock() + idx = we.mu.startIdx + we.mu.startIdx = (we.mu.startIdx + 1) % perWorkloadEventRetention + if we.mu.numEvents != len(we.events) { + we.mu.numEvents++ + } + }() we.events[idx] = ev - io.WriteString(l.outputFile, ev.String()+"\n") + _, _ = io.WriteString(l.outputFile, ev.String()+"\n") } // logOperationEvent logs an event in the operation log. Up to operationEventRetention @@ -137,16 +139,18 @@ func (l *eventLogger) logOperationEvent(ev Event) { ev.Timestamp = timeutil.Now() ev.Source = SourceOperation - l.mu.Lock() - idx := l.mu.operationStartIdx - l.mu.operationStartIdx = (l.mu.operationStartIdx + 1) % operationEventRetention - if l.mu.operationEvents != len(l.operationEvents) { - l.mu.operationEvents++ - } - l.mu.Unlock() - + var idx int + func() { + l.mu.Lock() + defer l.mu.Unlock() + idx = l.mu.operationStartIdx + l.mu.operationStartIdx = (l.mu.operationStartIdx + 1) % operationEventRetention + if l.mu.operationEvents != len(l.operationEvents) { + l.mu.operationEvents++ + } + }() l.operationEvents[idx] = ev - io.WriteString(l.outputFile, ev.String()+"\n") + _, _ = io.WriteString(l.outputFile, ev.String()+"\n") } // getWorkloadEvents returns workload events for a given workload worker. Up to diff --git a/pkg/cmd/drt-run/http.go b/pkg/cmd/drt-run/http.go index 07390ade57a7..b9b577acd473 100644 --- a/pkg/cmd/drt-run/http.go +++ b/pkg/cmd/drt-run/http.go @@ -100,7 +100,7 @@ func (h *httpHandler) serve(rw http.ResponseWriter, req *http.Request) { fmt.Fprintf(rw, "
") encoder := yaml.NewEncoder(rw) - encoder.Encode(h.w.config) + _ = encoder.Encode(h.w.config) fmt.Fprintf(rw, "") fmt.Fprintf(rw, "