Skip to content

SizeBudgetParser

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Parses size-budget spec strings. The grammar is [scope:]limit(,limit)* where scope is total (the default), ns=NAME, or asm=NAME, and each limit is max=SIZE or growth=SIZE|PERCENT. Sizes accept b, kb, mb, and gb suffixes (1 kb = 1024 bytes; a bare number is bytes); percentages (growth=1%) apply to growth only. Examples: max=25mb · growth=1% · total:max=25mb,growth=50kb · ns=System.Text.Json:growth=10kb · asm=MyApp:max=2mb.

public static class SizeBudgetParser

ObjectSizeBudgetParser

Parses one budget spec.

Parameters:

  • spec (String): The spec string.

Returns: SizeBudget

The parsed budget, at error severity.

Exceptions:

  • FormatException: The spec does not match the grammar; the message names the offending part.
public static SizeBudget Parse(string spec)