Docs · API reference · Motus.Abstractions

PerformanceBudgetAttribute Class#

Declares performance budget thresholds for a test method or class. Only specified metrics (values >= 0) are enforced. Method-level attributes override class-level attributes.

public sealed class PerformanceBudgetAttribute : System.Attribute

Inheritance System.Object → System.Attribute → PerformanceBudgetAttribute

Properties#

Cls Property#

Maximum Cumulative Layout Shift score. -1 means not set.

public double Cls { get; set; }

Property Value#

System.Double

DomNodeCount Property#

Maximum DOM node count. -1 means not set.

public int DomNodeCount { get; set; }

Property Value#

System.Int32

Fcp Property#

Maximum First Contentful Paint in milliseconds. -1 means not set.

public double Fcp { get; set; }

Property Value#

System.Double

Inp Property#

Maximum Interaction to Next Paint in milliseconds. -1 means not set.

public double Inp { get; set; }

Property Value#

System.Double

JsHeapSize Property#

Maximum JavaScript heap size in bytes. -1 means not set.

public long JsHeapSize { get; set; }

Property Value#

System.Int64

Lcp Property#

Maximum Largest Contentful Paint in milliseconds. -1 means not set.

public double Lcp { get; set; }

Property Value#

System.Double

Ttfb Property#

Maximum Time to First Byte in milliseconds. -1 means not set.

public double Ttfb { get; set; }

Property Value#

System.Double

Methods#

ToBudget() Method#

Converts the attribute values to a PerformanceBudget record. Sentinel values (-1) are mapped to null (not enforced).

public Motus.Abstractions.PerformanceBudget ToBudget();

Returns#

PerformanceBudget