Skip to content

Commit

Permalink
common: limit indexer status query by subgraph ids, add time logging …
Browse files Browse the repository at this point in the history
…for allocations query
  • Loading branch information
dwerner committed Jan 8, 2025
1 parent f17b402 commit f349b50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions packages/indexer-common/src/indexer-management/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export class NetworkMonitor {
}

async allocations(status: AllocationStatus): Promise<Allocation[]> {
const startTimeMs = Date.now()
try {
this.logger.debug(`Fetch ${status} allocations`)
let dataRemaining = true
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f349b50

Please sign in to comment.