Skip to content

SizeDiffPayloadBuilder

Namespace: Dotsider.Core.Protocol

Assembly: Dotsider.Core.dll

Builds the serializable payloads the diff-size and check-size-budgets surfaces return. The MCP server’s direct mode and the running-session protocol handler both call these, so the two transports cannot drift apart in shape or semantics.

public static class SizeDiffPayloadBuilder

ObjectSizeDiffPayloadBuilder

BuildBudgetPayload(MstatSource, MstatSource?, IReadOnlyList<SizeBudget>, int?)

Section titled “BuildBudgetPayload(MstatSource, MstatSource?, IReadOnlyList<SizeBudget>, int?)”

Builds the check-size-budgets payload: the basis-resolved totals and the budget report. Growth budgets without a baseline are the caller’s error to reject; this builder evaluates what it is given.

Parameters:

Returns: Object

The serializable payload.

public static object BuildBudgetPayload(MstatSource target, MstatSource? baseline, IReadOnlyList<SizeBudget> budgets, int? topN)

BuildDiffPayload(MstatSource, MstatSource, int?, bool, int?)

Section titled “BuildDiffPayload(MstatSource, MstatSource, int?, bool, int?)”

Builds the diff-size payload: the diff’s summary, aggregates, and top contributors, plus — only on request — the delta tree, pruned depth-first by absolute delta to a node cap with explicit truncation metadata, because a full tree for a real application is enormous.

Parameters:

Returns: Object

The serializable payload.

public static object BuildDiffPayload(MstatSource left, MstatSource right, int? topN, bool includeTree, int? maxNodes)

The default delta-tree node cap when a caller asks for the tree without one.

Returns: Int32

public const int DefaultMaxNodes = 500

The default contributor count when a caller does not pin one.

Returns: Int32

public const int DefaultTopN = 20