diff --git a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CommunityProcedureProvider.java b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CommunityProcedureProvider.java index 1c1bc9f4fd..d6a87f6573 100644 --- a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CommunityProcedureProvider.java +++ b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/CommunityProcedureProvider.java @@ -31,7 +31,6 @@ import org.neo4j.gds.algorithms.community.MutateNodePropertyService; import org.neo4j.gds.algorithms.community.WriteNodePropertyService; import org.neo4j.gds.algorithms.metrics.AlgorithmMetricsService; -import org.neo4j.gds.algorithms.metrics.PassthroughAlgorithmMetricRegistrar; import org.neo4j.gds.api.DatabaseId; import org.neo4j.gds.api.GraphLoaderContext; import org.neo4j.gds.api.ImmutableGraphLoaderContext; @@ -75,6 +74,7 @@ public class CommunityProcedureProvider { private final TerminationFlagService terminationFlagService; private final UserLogServices userLogServices; private final UserAccessor userAccessor; + private final AlgorithmMetricsService algorithmMetricsService; public CommunityProcedureProvider( Log log, @@ -87,7 +87,8 @@ public CommunityProcedureProvider( TaskRegistryFactoryService taskRegistryFactoryService, TerminationFlagService terminationFlagService, UserLogServices userLogServices, - UserAccessor userAccessor + UserAccessor userAccessor, + AlgorithmMetricsService algorithmMetricsService ) { this.log = log; this.graphStoreCatalogService = graphStoreCatalogService; @@ -101,6 +102,7 @@ public CommunityProcedureProvider( this.terminationFlagService = terminationFlagService; this.userLogServices = userLogServices; this.userAccessor = userAccessor; + this.algorithmMetricsService = algorithmMetricsService; } public CommunityProcedureFacade createCommunityProcedureFacade(Context context) throws ProcedureException { @@ -129,7 +131,7 @@ public CommunityProcedureFacade createCommunityProcedureFacade(Context context) taskRegistryFactory, userLogRegistryFactory, algorithmMemoryValidationService, - new AlgorithmMetricsService(new PassthroughAlgorithmMetricRegistrar()), + algorithmMetricsService, log ); diff --git a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/ExtensionBuilder.java b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/ExtensionBuilder.java index 511560b2c0..1d65744e2e 100644 --- a/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/ExtensionBuilder.java +++ b/procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/ExtensionBuilder.java @@ -200,7 +200,7 @@ public ThrowingFunction gdsProvid businessFacadeDecorator ); - var communityProcedureProvider = createCommunityProcedureProvider(exporterBuildersProviderService); + var communityProcedureProvider = createCommunityProcedureProvider(exporterBuildersProviderService, algorithmMetricsService); return new GraphDataScienceProvider(log, catalogFacadeProvider, communityProcedureProvider); } @@ -226,7 +226,9 @@ private CatalogFacadeProvider createCatalogFacadeProvider( ); } - private CommunityProcedureProvider createCommunityProcedureProvider(ExporterBuildersProviderService exporterBuildersProviderService) { + private CommunityProcedureProvider createCommunityProcedureProvider(ExporterBuildersProviderService exporterBuildersProviderService, + AlgorithmMetricsService algorithmMetricsService + ) { var algorithmMetaDataSetterService = new AlgorithmMetaDataSetterService(); return new CommunityProcedureProvider( @@ -240,7 +242,8 @@ private CommunityProcedureProvider createCommunityProcedureProvider(ExporterBuil taskRegistryFactoryService, terminationFlagService, userLogServices, - userAccessor + userAccessor, + algorithmMetricsService ); } }