diff --git a/packages/react-relay/relay-hooks/__tests__/useLazyLoadQueryNode-test.js b/packages/react-relay/relay-hooks/__tests__/useLazyLoadQueryNode-test.js index 1bc70458c3684..cc12edd2f79a9 100644 --- a/packages/react-relay/relay-hooks/__tests__/useLazyLoadQueryNode-test.js +++ b/packages/react-relay/relay-hooks/__tests__/useLazyLoadQueryNode-test.js @@ -961,7 +961,11 @@ describe('logging', () => { networkRequestId: 100000, }, { - name: 'execute.next', + name: 'execute.next.start', + executeId: 100001, + }, + { + name: 'execute.next.end', executeId: 100001, }, { @@ -1141,7 +1145,11 @@ describe('logging', () => { networkRequestId: 100001, }, { - name: 'execute.next', + name: 'execute.next.start', + executeId: 100002, + }, + { + name: 'execute.next.end', executeId: 100002, }, { diff --git a/packages/relay-runtime/store/OperationExecutor.js b/packages/relay-runtime/store/OperationExecutor.js index c67b425a85a1b..4edb8e93e63cc 100644 --- a/packages/relay-runtime/store/OperationExecutor.js +++ b/packages/relay-runtime/store/OperationExecutor.js @@ -375,16 +375,18 @@ class Executor { // Handle a raw GraphQL response. _next(_id: number, response: GraphQLResponse): void { this._schedule(() => { - const [start, duration] = withStartAndDuration(() => { - this._handleNext(response); - this._maybeCompleteSubscriptionOperationTracking(); + this._log({ + name: 'execute.next.start', + executeId: this._executeId, + response, + operation: this._operation, }); + this._handleNext(response); + this._maybeCompleteSubscriptionOperationTracking(); this._log({ - name: 'execute.next', + name: 'execute.next.end', executeId: this._executeId, response, - duration, - start, operation: this._operation, }); }); diff --git a/packages/relay-runtime/store/RelayStoreTypes.js b/packages/relay-runtime/store/RelayStoreTypes.js index 461154efc53a7..64f214641a415 100644 --- a/packages/relay-runtime/store/RelayStoreTypes.js +++ b/packages/relay-runtime/store/RelayStoreTypes.js @@ -652,12 +652,17 @@ export type ExecuteStartLogEvent = { +cacheConfig: CacheConfig, }; -export type ExecuteNextLogEvent = { - +name: 'execute.next', +export type ExecuteNextStartLogEvent = { + +name: 'execute.next.start', + +executeId: number, + +response: GraphQLResponse, + +operation: OperationDescriptor, +}; + +export type ExecuteNextEndLogEvent = { + +name: 'execute.next.end', +executeId: number, +response: GraphQLResponse, - +duration: number, - +start: number, +operation: OperationDescriptor, }; @@ -778,7 +783,8 @@ export type LogEvent = | NetworkCompleteLogEvent | NetworkUnsubscribeLogEvent | ExecuteStartLogEvent - | ExecuteNextLogEvent + | ExecuteNextStartLogEvent + | ExecuteNextEndLogEvent | ExecuteAsyncModuleLogEvent | ExecuteErrorLogEvent | ExecuteCompleteLogEvent