Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0651b82
adding Profiler
andimarek May 19, 2025
cc1de5e
progress
andimarek May 19, 2025
eef80ec
track running time
andimarek May 20, 2025
15cf642
tracking datafetcher result types
andimarek May 20, 2025
b7379ef
operation details
andimarek May 20, 2025
275eaac
wip
andimarek May 21, 2025
cd002c0
dataloader tracking
andimarek May 21, 2025
b75a14d
Merge branch 'master' into profiler-2
andimarek May 26, 2025
450a9fc
track dataloader dispatch
andimarek May 26, 2025
5e9e713
track dataloader dispatch
andimarek May 27, 2025
b3515b7
Merge branch 'master' into profiler-2
andimarek Jun 3, 2025
1800f77
Merge branch 'master' into profiler-2
andimarek Jun 30, 2025
221b416
non nullable handling
andimarek Jul 1, 2025
2ba4123
Merge branch 'master' into profiler-2
andimarek Jul 8, 2025
4008c11
master merging
andimarek Jul 9, 2025
f7e31e6
wip
andimarek Jul 16, 2025
3e29da4
Merge branch 'master' into profiler-2
andimarek Jul 16, 2025
999bb2f
handle non null case
andimarek Jul 16, 2025
5dde0e3
handle non null case
andimarek Jul 16, 2025
4a47b9d
add Map specific summary methods
andimarek Jul 17, 2025
0b7c15b
collect instrumentations
andimarek Jul 17, 2025
e6faa18
manual dispatch collected
andimarek Jul 18, 2025
0ab88da
wip
andimarek Jul 18, 2025
8bcdef8
wip
andimarek Jul 18, 2025
62f1e84
improve naming
andimarek Jul 18, 2025
76cdbc1
stabilize test
andimarek Jul 18, 2025
ca618b4
wip
andimarek Jul 18, 2025
535eb8e
counting wrapped trivial data fetchers
andimarek Jul 18, 2025
a04f5cb
introspection fields
andimarek Jul 19, 2025
572090e
data fetcher type statistics
andimarek Jul 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
andimarek committed Jul 16, 2025
commit f7e31e6cc90b6cec535a83c2a8b887558df49da7
18 changes: 8 additions & 10 deletions src/main/java/graphql/ProfilerResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import graphql.execution.ExecutionId;
import graphql.language.OperationDefinition;
import graphql.language.OperationDefinition.Operation;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

Expand Down Expand Up @@ -38,7 +39,7 @@ public class ProfilerResult {
@Nullable
private volatile String operationName;
@Nullable
private volatile String operationType;
private volatile Operation operationType;
private volatile boolean dataLoaderChainingEnabled;
private final Set<Integer> oldStrategyDispatchingAll = ConcurrentHashMap.newKeySet();
private final Set<Integer> chainedStrategyDispatching = ConcurrentHashMap.newKeySet();
Expand All @@ -48,9 +49,8 @@ public class ProfilerResult {

public static class DispatchEvent {
final String dataLoaderName;
final @Nullable
Integer level; // can be null for delayed dispatching
final int count;
final @Nullable Integer level; // is null for delayed dispatching
final int count; // how many

public DispatchEvent(String dataLoaderName, @Nullable Integer level, int count) {
this.dataLoaderName = dataLoaderName;
Expand Down Expand Up @@ -132,7 +132,7 @@ void setTimes(long startTime, long endTime, long engineTotalRunningTime) {

void setOperation(OperationDefinition operationDefinition) {
this.operationName = operationDefinition.getName();
this.operationType = operationDefinition.getOperation().name();
this.operationType = operationDefinition.getOperation();
}

void addDataLoaderUsed(String dataLoaderName) {
Expand All @@ -154,14 +154,12 @@ void addDispatchEvent(String dataLoaderName, @Nullable Integer level, int count)

// public getters

public String getOperationName() {
Assert.assertNotNull(operationName);
public @Nullable String getOperationName() {
return operationName;
}

public String getOperationType() {
Assert.assertNotNull(operationType);
return operationType;
public Operation getOperationType() {
return Assert.assertNotNull(operationType);
}

public Set<String> getFieldsFetched() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/groovy/graphql/ProfilerTest.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package graphql


import graphql.language.OperationDefinition
import graphql.schema.DataFetcher
import graphql.schema.DataFetchingEnvironment
import org.awaitility.Awaitility
Expand Down Expand Up @@ -205,7 +205,7 @@ class ProfilerTest extends Specification {

then:
profilerResult.getOperationName() == "MyQuery"
profilerResult.getOperationType() == "QUERY"
profilerResult.getOperationType() == OperationDefinition.Operation.QUERY


}
Expand Down