Skip to content

Commit 144c8a9

Browse files
committed
fix: enable include statistics on data loader dispatcher instrumentation
1 parent b3677b9 commit 144c8a9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

graphql-jpa-query-example-merge/src/main/resources/application.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ books:
3434

3535
logging:
3636
level:
37-
com.introproventures.graphql.jpa.query.schema: DEBUG
37+
com.introproventures.graphql.jpa.query.schema: DEBUG
38+
com.introproventures.graphql.jpa.query.example: DEBUG

graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContext.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ public DataLoaderRegistry newDataLoaderRegistry() {
9292
public Instrumentation newIstrumentation() {
9393
DataLoaderDispatcherInstrumentationOptions options = dataLoaderDispatcherInstrumentationOptions.get();
9494

95-
if (logger.isDebugEnabled()) {
96-
options.includeStatistics(true);
97-
}
98-
9995
DataLoaderDispatcherInstrumentation dispatcherInstrumentation = new DataLoaderDispatcherInstrumentation(options);
10096

10197
List<Instrumentation> list = Arrays.asList(dispatcherInstrumentation,

graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContextFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ public class GraphQLJpaExecutorContextFactory implements GraphQLExecutorContextF
4242
private Supplier<Instrumentation> instrumentation = () -> new SimpleInstrumentation();
4343
private Supplier<GraphQLContext> graphqlContext = () -> GraphQLContext.newContext().build();
4444
private Supplier<DataLoaderDispatcherInstrumentationOptions> dataLoaderDispatcherInstrumentationOptions = () -> {
45-
return DataLoaderDispatcherInstrumentationOptions.newOptions();
45+
DataLoaderDispatcherInstrumentationOptions options = DataLoaderDispatcherInstrumentationOptions.newOptions();
46+
47+
return logger.isDebugEnabled() ? options.includeStatistics(true)
48+
: options;
4649
};
4750

4851
private Supplier<DataLoaderOptions> dataLoaderOptions = () -> DataLoaderOptions.newOptions();

0 commit comments

Comments
 (0)