SizeBudget
Namespace: Dotsider.Core.Analysis.Models
Assembly: Dotsider.Core.dll
One size budget: a scope plus at least one limit. Parsed from the spec grammar
([scope:]limit(,limit)* — for example total:max=25mb,growth=1% or
ns=System.Text.Json:growth=10kb) by
SizeBudgetParser, or from a budget file’s object form
which can also carry a name, description, severity, and per-budget contributor count.
public sealed record SizeBudget : IEquatable<SizeBudget>Inheritance
Section titled “Inheritance”Object → SizeBudget
Implements
Section titled “Implements”Constructors
Section titled “Constructors”SizeBudget(SizeBudgetScope, string?, long?, long?, double?, SizeBudgetSeverity, string?, string?, int?)
Section titled “SizeBudget(SizeBudgetScope, string?, long?, long?, double?, SizeBudgetSeverity, string?, string?, int?)”One size budget: a scope plus at least one limit. Parsed from the spec grammar
([scope:]limit(,limit)* — for example total:max=25mb,growth=1% or
ns=System.Text.Json:growth=10kb) by
SizeBudgetParser, or from a budget file’s object form
which can also carry a name, description, severity, and per-budget contributor count.
Parameters:
Scope(SizeBudgetScope): What the budget measures.Target(String): The namespace prefix or assembly simple name, or null for Total.MaxBytes(Nullable<Int64>): The absolute cap on the current value in bytes, or null when not limited.MaxGrowthBytes(Nullable<Int64>): The cap on growth versus the baseline in bytes, or null when not limited.MaxGrowthPercent(Nullable<Double>): The cap on growth versus the baseline as a percentage, or null when not limited.Severity(SizeBudgetSeverity): Whether a breach fails the check or only warns.Name(String): A stable display name for reports, or null to render the spec itself.Description(String): An explanation shown alongside a breach, or null.TopN(Nullable<Int32>): A per-budget override for how many contributors a breach lists, or null for the caller’s default.
public SizeBudget(SizeBudgetScope Scope, string? Target, long? MaxBytes, long? MaxGrowthBytes, double? MaxGrowthPercent, SizeBudgetSeverity Severity = SizeBudgetSeverity.Error, string? Name = null, string? Description = null, int? TopN = null)Properties
Section titled “Properties”Description
Section titled “Description”An explanation shown alongside a breach, or null.
Returns: String
public string? Description { get; init; }MaxBytes
Section titled “MaxBytes”The absolute cap on the current value in bytes, or null when not limited.
Returns: Nullable<Int64>
public long? MaxBytes { get; init; }MaxGrowthBytes
Section titled “MaxGrowthBytes”The cap on growth versus the baseline in bytes, or null when not limited.
Returns: Nullable<Int64>
public long? MaxGrowthBytes { get; init; }MaxGrowthPercent
Section titled “MaxGrowthPercent”The cap on growth versus the baseline as a percentage, or null when not limited.
Returns: Nullable<Double>
public double? MaxGrowthPercent { get; init; }A stable display name for reports, or null to render the spec itself.
Returns: String
public string? Name { get; init; }What the budget measures.
Returns: SizeBudgetScope
public SizeBudgetScope Scope { get; init; }Severity
Section titled “Severity”Whether a breach fails the check or only warns.
Returns: SizeBudgetSeverity
public SizeBudgetSeverity Severity { get; init; }Target
Section titled “Target”The namespace prefix or assembly simple name, or null for Total.
Returns: String
public string? Target { get; init; }A per-budget override for how many contributors a breach lists, or null for the caller’s default.
Returns: Nullable<Int32>
public int? TopN { get; init; }Methods
Section titled “Methods”Deconstruct(out SizeBudgetScope, out string?, out long?, out long?, out double?, out SizeBudgetSeverity, out string?, out string?, out int?)
Section titled “Deconstruct(out SizeBudgetScope, out string?, out long?, out long?, out double?, out SizeBudgetSeverity, out string?, out string?, out int?)”Parameters:
Scope(SizeBudgetScope)Target(String)MaxBytes(Nullable<Int64>)MaxGrowthBytes(Nullable<Int64>)MaxGrowthPercent(Nullable<Double>)Severity(SizeBudgetSeverity)Name(String)Description(String)TopN(Nullable<Int32>)
public void Deconstruct(out SizeBudgetScope Scope, out string? Target, out long? MaxBytes, out long? MaxGrowthBytes, out double? MaxGrowthPercent, out SizeBudgetSeverity Severity, out string? Name, out string? Description, out int? TopN)Equals(object?)
Section titled “Equals(object?)”Parameters:
obj(Object)
Returns: Boolean
public override bool Equals(object? obj)Equals(SizeBudget?)
Section titled “Equals(SizeBudget?)”Parameters:
other(SizeBudget)
Returns: Boolean
public bool Equals(SizeBudget? other)GetHashCode()
Section titled “GetHashCode()”Returns: Int32
public override int GetHashCode()ToString()
Section titled “ToString()”Renders the budget back into spec-grammar form, for display when it has no Name.
Returns: String
The spec string.
public override string ToString()Members
Section titled “Members”operator !=(SizeBudget?, SizeBudget?)
Section titled “operator !=(SizeBudget?, SizeBudget?)”Parameters:
left(SizeBudget)right(SizeBudget)
Returns: Boolean
public static bool operator !=(SizeBudget? left, SizeBudget? right)operator ==(SizeBudget?, SizeBudget?)
Section titled “operator ==(SizeBudget?, SizeBudget?)”Parameters:
left(SizeBudget)right(SizeBudget)
Returns: Boolean
public static bool operator ==(SizeBudget? left, SizeBudget? right)