-
Notifications
You must be signed in to change notification settings - Fork 723
add time duration logging to runtime go code #2515
add time duration logging to runtime go code #2515
Conversation
defer func() { logger.Debug("Exiting DataCollection.get", result) }() | ||
|
||
// Validate the arguments from JavaScript. | ||
id := vm.RequireString(0) | ||
vm.RequireFunction(1) | ||
|
||
increment := time.Now(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you will care about the time it takes to create a composite key. This is actually a very simple method that just does string concatenation.
@@ -203,6 +241,9 @@ func (dataCollection *DataCollection) exists(vm *duktape.Context) (result int) { | |||
return 0 | |||
} | |||
|
|||
logger.Debug("@perf DataCollection.get CreateCompositeKey duration for [", dataCollection.CollectionID, "] and transaction [", dataCollection.Stub.GetTxID(),"] :", time.Now().Sub(increment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about createCompositeKey
@@ -252,6 +304,8 @@ func (dataCollection *DataCollection) add(vm *duktape.Context) (result int) { | |||
return 0 | |||
} | |||
|
|||
logger.Debug("@perf DataCollection.get CreateCompositeKey duration for [", dataCollection.CollectionID, "] and transaction [", dataCollection.Stub.GetTxID(),"] :", time.Now().Sub(increment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same about createCompositeKey
@@ -319,6 +387,9 @@ func (dataCollection *DataCollection) update(vm *duktape.Context) (result int) { | |||
return 0 | |||
} | |||
|
|||
logger.Debug("@perf DataCollection.update CreateCompositeKey duration for collection [",dataCollection.CollectionID, "] and transaction [", dataCollection.Stub.GetTxID(),"] :", time.Now().Sub(increment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about createCompositeKey
@@ -378,6 +463,9 @@ func (dataCollection *DataCollection) remove(vm *duktape.Context) (result int) { | |||
return 0 | |||
} | |||
|
|||
logger.Debug("@perf DataCollection.remove CreateCompositeKey duration for collection [",dataCollection.CollectionID, "] and transaction [", dataCollection.Stub.GetTxID(),"] :", time.Now().Sub(increment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about createCompositeKey
@@ -254,18 +279,26 @@ func (dataService *DataService) getCollection(vm *duktape.Context) (result int) | |||
if vm.Pcall(2) == duktape.ExecError { | |||
panic(vm.ToString(-1)) | |||
} | |||
|
|||
logger.Debug("@perf DataService.getCollection callback duraion for txnId [", dataService.Stub.GetTxID(), "] : ", time.Now().Sub(increment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor spelling mistake :-)
@@ -278,6 +311,9 @@ func (dataService *DataService) existsCollection(vm *duktape.Context) (result in | |||
return 0 | |||
} | |||
|
|||
logger.Debug("@perf DataService.existsCollection CreateCompositeKey duration for txnId [", dataService.Stub.GetTxID(), "] : ", time.Now().Sub(increment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createCompositeKey comment
defer func() { logger.Debug("Exiting DataService.clearCollection", err) }() | ||
|
||
increment = time.Now(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed a colon
b1da804
to
a4fab97
Compare
Signed-off-by: Nick Lincoln <nkl199@yahoo.co.uk>
a4fab97
to
413069b
Compare
closes #2514
Adds duration timestamp information through the go code under runtime hlfv1, will be observed within debug trace only