This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/eventmesh-go.git
The following commit(s) were added to refs/heads/main by this push:
new 4d3ac71 Update producer_processor.go
new 73214d7 Merge pull request #10 from harshithasudhakar/patch-4
4d3ac71 is described below
commit 4d3ac7120140ce85356c17763013900b92f881a2
Author: Harshitha Sudhakar
<[email protected]>
AuthorDate: Mon Apr 24 10:59:29 2023 +0530
Update producer_processor.go
Replaced time.Now().Sub() with time.Since() in lines
102,107,165,170,223,235,292,296
---
.../core/protocol/grpc/producer/producer_processor.go | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/runtime/core/protocol/grpc/producer/producer_processor.go
b/runtime/core/protocol/grpc/producer/producer_processor.go
index 62baa68..86fc826 100644
--- a/runtime/core/protocol/grpc/producer/producer_processor.go
+++ b/runtime/core/protocol/grpc/producer/producer_processor.go
@@ -99,12 +99,12 @@ func (p *processor) AsyncMessage(ctx context.Context,
producerMgr ProducerManage
OnSuccess: func(result *connector.SendResult) {
code = grpc.SUCCESS
log.Infof("message|eventMesh2mq|REQ|ASYNC|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v",
- time.Now().Sub(start).Milliseconds(),
topic, seqNum, uid)
+ time.Since(start).Milliseconds(),
topic, seqNum, uid)
},
OnError: func(result *connector.ErrorResult) {
code = grpc.EVENTMESH_SEND_ASYNC_MSG_ERR
log.Errorf("message|eventMesh2mq|REQ|ASYNC|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v,
err:%v",
- time.Now().Sub(start).Milliseconds(),
topic, seqNum, uid, result.Err)
+ time.Since(start).Milliseconds(),
topic, seqNum, uid, result.Err)
},
},
); err != nil {
@@ -162,12 +162,12 @@ func (p *processor) ReplyMessage(ctx context.Context,
producerMgr ProducerManage
&connector.SendCallback{
OnSuccess: func(result *connector.SendResult) {
log.Infof("message|mq2eventmesh|REPLY|ReplyToServer|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v",
- time.Now().Sub(start).Milliseconds(),
replyTopic, seqNum, uniqID)
+ time.Since(start).Milliseconds(),
replyTopic, seqNum, uniqID)
},
OnError: func(result *connector.ErrorResult) {
emiter.SendStreamResp(hdr,
grpc.EVENTMESH_REPLY_MSG_ERR)
log.Errorf("message|mq2eventmesh|REPLY|ReplyToServer|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v",
- time.Now().Sub(start).Milliseconds(),
replyTopic, seqNum, uniqID, result.Err)
+ time.Since(start).Milliseconds(),
replyTopic, seqNum, uniqID, result.Err)
},
},
)
@@ -220,7 +220,7 @@ func (p *processor) RequestReplyMessage(ctx
context.Context, producerMgr Produce
&connector.RequestReplyCallback{
OnSuccess: func(event *ce.Event) {
log.Infof("message|eventmesh2client|REPLY|RequestReply|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v",
- time.Now().Sub(start).Milliseconds(),
topic, seqNum, unidID)
+ time.Since(start).Milliseconds(),
topic, seqNum, unidID)
m1, err1 := adp.FromCloudEvent(event)
if err1 != nil {
@@ -232,7 +232,7 @@ func (p *processor) RequestReplyMessage(ctx
context.Context, producerMgr Produce
},
OnError: func(result *connector.ErrorResult) {
log.Errorf("message|mq2eventmesh|REPLY|RequestReply|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v|err=%v",
- time.Now().Sub(start).Milliseconds(),
topic, seqNum, unidID, err)
+ time.Since(start).Milliseconds(),
topic, seqNum, unidID, err)
err =
grpc.EVENTMESH_REQUEST_REPLY_MSG_ERR.ToError()
},
},
@@ -289,11 +289,11 @@ func (p *processor) BatchPublish(ctx context.Context,
producerMgr ProducerManage
&connector.SendCallback{
OnSuccess: func(result *connector.SendResult) {
log.Infof("message|eventMesh2mq|REQ|BatchSend|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v",
-
time.Now().Sub(start).Milliseconds(), topic, seqNum, uid)
+
time.Since(start).Milliseconds(), topic, seqNum, uid)
},
OnError: func(result *connector.ErrorResult) {
log.Errorf("message|eventMesh2mq|REQ|BatchSend|send2MQCost=%vms|topic=%v|bizSeqNo=%v|uniqueId=%v,
err:%v",
-
time.Now().Sub(start).Milliseconds(), topic, seqNum, uid, result.Err)
+
time.Since(start).Milliseconds(), topic, seqNum, uid, result.Err)
},
},
)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]