From f349b50f7d7643e3e0d531a90c71f87e015c3b8b Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Fri, 27 Dec 2024 14:28:20 -0800 Subject: [PATCH] common: limit indexer status query by subgraph ids, add time logging for allocations query --- packages/indexer-common/src/indexer-management/allocations.ts | 4 +++- packages/indexer-common/src/indexer-management/monitor.ts | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/indexer-common/src/indexer-management/allocations.ts b/packages/indexer-common/src/indexer-management/allocations.ts index a26f82cb5..035aa0932 100644 --- a/packages/indexer-common/src/indexer-management/allocations.ts +++ b/packages/indexer-common/src/indexer-management/allocations.ts @@ -251,7 +251,9 @@ export class AllocationManager { 2, ), currentEpoch, - indexingStatuses: await this.graphNode.indexingStatus([]), + indexingStatuses: await this.graphNode.indexingStatus( + actions.map((action) => new SubgraphDeploymentID(action.deploymentID!)), + ), } return await pMap( actions, diff --git a/packages/indexer-common/src/indexer-management/monitor.ts b/packages/indexer-common/src/indexer-management/monitor.ts index 56a8b13cd..249a414f3 100644 --- a/packages/indexer-common/src/indexer-management/monitor.ts +++ b/packages/indexer-common/src/indexer-management/monitor.ts @@ -132,6 +132,7 @@ export class NetworkMonitor { } async allocations(status: AllocationStatus): Promise { + const startTimeMs = Date.now() try { this.logger.debug(`Fetch ${status} allocations`) let dataRemaining = true @@ -202,6 +203,9 @@ export class NetworkMonitor { ) } + this.logger.debug( + `Finished fetching ${status} allocations in ${Date.now() - startTimeMs}ms`, + ) return allocations } catch (error) { const err = indexerError(IndexerErrorCode.IE010, error)