Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
3 changes: 2 additions & 1 deletion downstreamadapter/sink/cloudstorage/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ func (s *sink) writeFile(v *commonEvent.DDLEvent, def cloudstorage.TableDefiniti
}
log.Debug("write ddl event to external storage",
zap.String("path", path), zap.Any("ddl", v))
return s.statistics.RecordDDLExecution(func() error {
ddlType := v.GetDDLType().String()
return s.statistics.RecordDDLExecution(ddlType, func() error {
err = s.storage.WriteFile(s.ctx, path, encodedDef)
if err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions downstreamadapter/sink/kafka/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,13 @@ func (s *sink) sendDDLEvent(event *commonEvent.DDLEvent) error {
if err != nil {
return err
}
ddlType := e.GetDDLType().String()
if s.partitionRule == helper.PartitionAll {
err = s.statistics.RecordDDLExecution(func() error {
err = s.statistics.RecordDDLExecution(ddlType, func() error {
return s.ddlProducer.SendMessages(topic, partitionNum, message)
})
} else {
err = s.statistics.RecordDDLExecution(func() error {
err = s.statistics.RecordDDLExecution(ddlType, func() error {
return s.ddlProducer.SendMessage(topic, 0, message)
})
}
Expand Down
5 changes: 3 additions & 2 deletions downstreamadapter/sink/pulsar/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ func (s *sink) sendDDLEvent(event *commonEvent.DDLEvent) error {
if err != nil {
return err
}
ddlType := e.GetDDLType().String()
if s.partitionRule == helper.PartitionAll {
err = s.statistics.RecordDDLExecution(func() error {
err = s.statistics.RecordDDLExecution(ddlType, func() error {
return s.ddlProducer.syncBroadcastMessage(s.ctx, topic, message)
})
} else {
err = s.statistics.RecordDDLExecution(func() error {
err = s.statistics.RecordDDLExecution(ddlType, func() error {
return s.ddlProducer.syncSendMessage(s.ctx, topic, message)
})
}
Expand Down
3 changes: 2 additions & 1 deletion downstreamadapter/sink/redo/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ func (s *Sink) Run(ctx context.Context) error {
func (s *Sink) WriteBlockEvent(event commonEvent.BlockEvent) error {
switch e := event.(type) {
case *commonEvent.DDLEvent:
err := s.statistics.RecordDDLExecution(func() error {
ddlType := e.GetDDLType().String()
err := s.statistics.RecordDDLExecution(ddlType, func() error {
return s.ddlWriter.WriteEvents(s.ctx, e)
})
if err != nil {
Expand Down
Loading