Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

add time duration logging to runtime go code #2515

Merged
merged 2 commits into from
Nov 1, 2017

Conversation

nklincoln
Copy link
Contributor

closes #2514

Adds duration timestamp information through the go code under runtime hlfv1, will be observed within debug trace only

defer func() { logger.Debug("Exiting DataCollection.get", result) }()

// Validate the arguments from JavaScript.
id := vm.RequireString(0)
vm.RequireFunction(1)

increment := time.Now();
Copy link
Contributor

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))
Copy link
Contributor

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))
Copy link
Contributor

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))
Copy link
Contributor

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))
Copy link
Contributor

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))
Copy link
Contributor

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))
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed a colon

@nklincoln nklincoln force-pushed the add-perf-trace branch 2 times, most recently from b1da804 to a4fab97 Compare November 1, 2017 13:26
Signed-off-by: Nick Lincoln <nkl199@yahoo.co.uk>
@nklincoln nklincoln merged commit f49b0a2 into hyperledger-archives:master Nov 1, 2017
@nklincoln nklincoln deleted the add-perf-trace branch November 3, 2017 16:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add timing debug into product to assist with diagnosis
2 participants