Skip to content

Commit

Permalink
Include size of top-level node in structured output
Browse files Browse the repository at this point in the history
Summary: Include the size of the root node in (structured) output of `heapdom` command.

Differential Revision: D55339806

fbshipit-source-id: 6ad5ab311eb63577ba55fff2e15ede88265318d2
  • Loading branch information
elliekorn authored and facebook-github-bot committed Mar 25, 2024
1 parent a405776 commit 1635366
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Commands/HeapDomCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,12 @@ public override void Run()
throw new CommandException(ex.Message);
}

long rootNodeInclusiveSize = heapDomSizes.TreeSize(CurrentHeapDom.RootNodeIndex);
Output.AddProperty("numberOfNodesWritten", m_numberOfNodesWritten);
Output.AddDisplayStringLine("wrote {0} nodes", m_numberOfNodesWritten);
Output.AddProperty("numberOfBytesInNodesWritten", rootNodeInclusiveSize);
Output.AddDisplayStringLine("wrote {0} nodes with a total of {1} bytes",
m_numberOfNodesWritten,
rootNodeInclusiveSize);
}

void StartHtmlFile(string htmlDestination)
Expand Down

0 comments on commit 1635366

Please sign in to comment.