mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Turbopack: also add edge count to trace (#93314)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Signed commits - This repository requires verified commit signatures on protected branches. - If this pull request is blocked for unsigned commits, re-sign the commits and force-push the branch. - A `Signed-off-by` line in the commit message is not enough. ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
This commit is contained in:
@@ -2482,7 +2482,7 @@ async fn scale_down_node_pool(project: ResolvedVc<Project>) -> Result<()> {
|
||||
async fn whole_app_module_graph_operation(
|
||||
project: ResolvedVc<Project>,
|
||||
) -> Result<Vc<BaseAndFullModuleGraph>> {
|
||||
let span = tracing::info_span!("whole app module graph", modules = Empty);
|
||||
let span = tracing::info_span!("whole app module graph", modules = Empty, edges = Empty);
|
||||
let span_clone = span.clone();
|
||||
async move {
|
||||
let next_mode = project.next_mode();
|
||||
@@ -2529,15 +2529,24 @@ async fn whole_app_module_graph_operation(
|
||||
.connect()
|
||||
.module_count()
|
||||
.untracked()
|
||||
.owned()
|
||||
.await?;
|
||||
let additional_module_count = additional_module_graph
|
||||
.connect()
|
||||
.module_count()
|
||||
.untracked()
|
||||
.owned()
|
||||
.await?;
|
||||
span.record("modules", base_module_count + additional_module_count);
|
||||
span.record("modules", *base_module_count + *additional_module_count);
|
||||
let base_edge_count = base_single_module_graph
|
||||
.connect()
|
||||
.edge_count()
|
||||
.untracked()
|
||||
.await?;
|
||||
let additional_edge_count = additional_module_graph
|
||||
.connect()
|
||||
.edge_count()
|
||||
.untracked()
|
||||
.await?;
|
||||
span.record("edges", *base_edge_count + *additional_edge_count);
|
||||
}
|
||||
|
||||
let graphs = vec![base_single_module_graph, additional_module_graph];
|
||||
|
||||
@@ -1563,8 +1563,13 @@ impl SingleModuleGraph {
|
||||
}
|
||||
|
||||
#[turbo_tasks::function]
|
||||
pub async fn module_count(&self) -> Result<Vc<u64>> {
|
||||
Ok(Vc::cell(self.number_of_modules as u64))
|
||||
pub async fn module_count(&self) -> Vc<u64> {
|
||||
Vc::cell(self.number_of_modules as u64)
|
||||
}
|
||||
|
||||
#[turbo_tasks::function]
|
||||
pub async fn edge_count(&self) -> Vc<u64> {
|
||||
Vc::cell(self.graph.edge_count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user