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#
DomNodeCount Property#
Maximum DOM node count. -1 means not set.
public int DomNodeCount { get; set; }
Property Value#
Fcp Property#
Maximum First Contentful Paint in milliseconds. -1 means not set.
public double Fcp { get; set; }
Property Value#
Inp Property#
Maximum Interaction to Next Paint in milliseconds. -1 means not set.
public double Inp { get; set; }
Property Value#
JsHeapSize Property#
Maximum JavaScript heap size in bytes. -1 means not set.
public long JsHeapSize { get; set; }
Property Value#
Lcp Property#
Maximum Largest Contentful Paint in milliseconds. -1 means not set.
public double Lcp { get; set; }
Property Value#
Ttfb Property#
Maximum Time to First Byte in milliseconds. -1 means not set.
public double Ttfb { get; set; }
Property Value#
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();