Skip to content

Commit 901da18

Browse files
committed
workload/changefeeds: add more logs
1 parent ecee0e1 commit 901da18

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/workload/changefeeds/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ go_library(
77
visibility = ["//visibility:public"],
88
deps = [
99
"//pkg/util/hlc",
10+
"//pkg/util/log",
1011
"//pkg/util/timeutil",
1112
"//pkg/workload",
1213
"//pkg/workload/histogram",

pkg/workload/changefeeds/changefeeds.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import (
99
"context"
1010
"encoding/json"
1111
"fmt"
12+
"strconv"
1213
"strings"
1314
"time"
1415

1516
"github.com/cockroachdb/cockroach/pkg/util/hlc"
17+
"github.com/cockroachdb/cockroach/pkg/util/log"
1618
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
1719
"github.com/cockroachdb/cockroach/pkg/workload"
1820
"github.com/cockroachdb/cockroach/pkg/workload/histogram"
@@ -84,6 +86,8 @@ func AddChangefeedToQueryLoad(
8486
return err
8587
}
8688

89+
log.Dev.Infof(ctx, "cursor: %s", cursorStr)
90+
8791
tableNames := strings.Builder{}
8892
for i, table := range gen.Tables() {
8993
if i == 0 {
@@ -127,6 +131,11 @@ func AddChangefeedToQueryLoad(
127131
if rows != nil {
128132
return false
129133
}
134+
log.Dev.Infof(ctx, "creating changefeed with stmt: %s with args %v", stmt, args)
135+
if epoch, parseErr := strconv.ParseInt(cursorStr, 10, 64); parseErr == nil {
136+
t := time.Unix(epoch, 0).UTC()
137+
log.Dev.Infof(ctx, "starting a changefeed after %s", time.Since(t))
138+
}
130139
var err error
131140
rows, err = conn.Query(cfCtx, stmt, args...)
132141
return maybeMarkDone(err)

0 commit comments

Comments
 (0)