Skip to content

Commit 78084b7

Browse files
authored
Merge pull request #199 from graphql-java/profiler-amendment
Add a note on instrumentation logging not having access to engine timing
2 parents f773a0e + dab0738 commit 78084b7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

documentation/profiler.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ if (profilerResult != null) {
5252
}
5353
```
5454

55-
You could alternatively access and log the request's `ProfilerResult` from an `Instrumentation`.
56-
5755
## Understanding the Profiler Results
5856

5957
A great way to get a quick overview about `ProfilerResult` is by using the `shortSummaryMap()` method. It returns a map with key metrics about the execution, which you can use for logging. Let's break down what each key means.
@@ -110,3 +108,9 @@ Here's what the result types mean:
110108
| `COMPLETABLE_FUTURE_COMPLETED` | The DataFetcher returned a `CompletableFuture` that was already completed when it was returned. |
111109
| `COMPLETABLE_FUTURE_NOT_COMPLETED` | The DataFetcher returned an incomplete `CompletableFuture`. |
112110
| `MATERIALIZED` | The DataFetcher returned a simple value (i.e., not a `CompletableFuture`). |
111+
112+
### A note on engine timing statistics logged from an `Instrumentation`
113+
114+
If you're logging the `ProfilerResult` from an `Instrumentation`, note that engine timing statistics such as `startTimeNs`, `endTimeNs`, `totalRunTimeNs`, `engineTotalRunningTimeNs` will be set to `0`. This is because the timing is set after all `Instrumentation`s have run, so it is not available from within an `Instrumentation`.
115+
116+
Apart from engine timing information, all other `ProfilerResult` information is still valid if accessed from within an `Instrumentation`.

0 commit comments

Comments
 (0)