Skip to content

Commit f349b50

Browse files
committed
common: limit indexer status query by subgraph ids, add time logging for allocations query
1 parent f17b402 commit f349b50

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/indexer-common/src/indexer-management/allocations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ export class AllocationManager {
251251
2,
252252
),
253253
currentEpoch,
254-
indexingStatuses: await this.graphNode.indexingStatus([]),
254+
indexingStatuses: await this.graphNode.indexingStatus(
255+
actions.map((action) => new SubgraphDeploymentID(action.deploymentID!)),
256+
),
255257
}
256258
return await pMap(
257259
actions,

packages/indexer-common/src/indexer-management/monitor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export class NetworkMonitor {
132132
}
133133

134134
async allocations(status: AllocationStatus): Promise<Allocation[]> {
135+
const startTimeMs = Date.now()
135136
try {
136137
this.logger.debug(`Fetch ${status} allocations`)
137138
let dataRemaining = true
@@ -202,6 +203,9 @@ export class NetworkMonitor {
202203
)
203204
}
204205

206+
this.logger.debug(
207+
`Finished fetching ${status} allocations in ${Date.now() - startTimeMs}ms`,
208+
)
205209
return allocations
206210
} catch (error) {
207211
const err = indexerError(IndexerErrorCode.IE010, error)

0 commit comments

Comments
 (0)