@@ -57,17 +57,17 @@ class NodeDataService extends DataService {
5757 if ( value . length === 0 ) {
5858 let result = await this . _storeCollection ( key , id ) ;
5959 LOG . exit ( method , result ) ;
60- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
60+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
6161 return result ;
6262 }
6363 else {
64- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
64+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
6565 throw new Error ( `Failed to create collection with ID ${ id } as it already exists` ) ;
6666 }
6767 } else {
6868 let result = await this . _storeCollection ( key , id ) ;
6969 LOG . exit ( method , result ) ;
70- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
70+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
7171 return result ;
7272 }
7373 }
@@ -88,7 +88,7 @@ class NodeDataService extends DataService {
8888 await this . stub . putState ( key , Buffer . from ( JSON . stringify ( { 'id' : id } ) ) ) ;
8989 let retVal = new NodeDataCollection ( this , this . stub , id ) ;
9090 LOG . exit ( method , retVal ) ;
91- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
91+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
9292 return retVal ;
9393 }
9494
@@ -104,13 +104,13 @@ class NodeDataService extends DataService {
104104 let key = this . stub . createCompositeKey ( collectionObjectType , [ id ] ) ;
105105 let exists = await this . existsCollection ( id ) ;
106106 if ( ! exists ) {
107- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
107+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
108108 throw new Error ( `Collection with ID ${ id } does not exist` ) ;
109109 }
110110 await this . clearCollection ( id ) ;
111111 await this . stub . deleteState ( key ) ;
112112 LOG . exit ( method ) ;
113- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
113+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
114114 }
115115
116116 /**
@@ -128,18 +128,18 @@ class NodeDataService extends DataService {
128128 if ( bypass ) {
129129 let retVal = new NodeDataCollection ( this , this . stub , id ) ;
130130 LOG . exit ( method , retVal ) ;
131- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
131+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
132132 return retVal ;
133133 } else {
134134 let key = this . stub . createCompositeKey ( collectionObjectType , [ id ] ) ;
135135 let value = await this . stub . getState ( key ) ;
136136 if ( value . length === 0 ) {
137- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
137+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
138138 throw new Error ( `Collection with ID ${ id } does not exist` ) ;
139139 }
140140 let retVal = new NodeDataCollection ( this , this . stub , id ) ;
141141 LOG . exit ( method , retVal ) ;
142- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
142+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
143143 return retVal ;
144144 }
145145 }
@@ -159,7 +159,7 @@ class NodeDataService extends DataService {
159159 let value = await this . stub . getState ( key ) ;
160160 let retVal = value . length !== 0 ;
161161 LOG . exit ( method , retVal ) ;
162- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
162+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
163163 return retVal ;
164164 }
165165
@@ -176,9 +176,9 @@ class NodeDataService extends DataService {
176176 const t0 = Date . now ( ) ;
177177
178178 let iterator = await this . stub . getQueryResult ( query ) ;
179- let results = await NodeUtils . getAllResults ( iterator ) ;
179+ let results = await NodeUtils . getAllResults ( iterator , this . stub ) ;
180180 LOG . exit ( method , results ) ;
181- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
181+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
182182 return results ;
183183 }
184184
@@ -194,7 +194,7 @@ class NodeDataService extends DataService {
194194 let iterator = await this . stub . getStateByPartialCompositeKey ( id , [ ] ) ;
195195 await NodeUtils . deleteAllResults ( iterator , this . stub ) ;
196196 LOG . exit ( method ) ;
197- LOG . verbose ( '@PERF ' + method , 'Total (ms) duration: ' + ( Date . now ( ) - t0 ) . toFixed ( 2 ) ) ;
197+ LOG . perf ( method , 'Total (ms) duration: ' , this . stub . getTxID ( ) , t0 ) ;
198198 }
199199}
200200
0 commit comments