Skip to content

Commit

Permalink
mq(ticdc): fix send message time cost duration metrics inaccurate (#7578
Browse files Browse the repository at this point in the history
)

close #7577
  • Loading branch information
3AceShowHand authored Nov 10, 2022
1 parent b31400b commit c982fca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cdc/sinkv2/eventsink/mq/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ func (w *worker) sendMessages(ctx context.Context) error {
zap.String("changefeed", w.changeFeedID.ID))
return nil
}
start := time.Now()
if err := future.Ready(ctx); err != nil {
return errors.Trace(err)
}
for _, message := range future.Messages {
start := time.Now()
if err := w.statistics.RecordBatchExecution(func() (int, error) {
if err := w.producer.AsyncSendMessage(ctx, future.Topic, future.Partition, message); err != nil {
return 0, err
Expand Down
2 changes: 1 addition & 1 deletion cdc/sinkv2/metrics/mq/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
Namespace: "ticdc",
Subsystem: "sinkv2",
Name: "mq_worker_send_message_duration",
Help: "Flush duration(s) for MQ worker.",
Help: "Send Message duration(s) for MQ worker.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~1000s
}, []string{"namespace", "changefeed"})
// WorkerBatchSize record the size of each batched messages.
Expand Down

0 comments on commit c982fca

Please sign in to comment.