Docs · API reference · Motus.Abstractions

PerformanceBudget Class#

Defines performance budget thresholds. Only non-null metrics are enforced.

public sealed record PerformanceBudget : System.IEquatable<Motus.Abstractions.PerformanceBudget>

Inheritance System.Object → PerformanceBudget

Implements System.IEquatable<PerformanceBudget>

Properties#

Cls Property#

Maximum Cumulative Layout Shift score.

public System.Nullable<double> Cls { get; init; }

Property Value#

System.Nullable<System.Double>

DomNodeCount Property#

Maximum DOM node count.

public System.Nullable<int> DomNodeCount { get; init; }

Property Value#

System.Nullable<System.Int32>

Fcp Property#

Maximum First Contentful Paint in milliseconds.

public System.Nullable<double> Fcp { get; init; }

Property Value#

System.Nullable<System.Double>

Inp Property#

Maximum Interaction to Next Paint in milliseconds.

public System.Nullable<double> Inp { get; init; }

Property Value#

System.Nullable<System.Double>

JsHeapSize Property#

Maximum JavaScript heap size in bytes.

public System.Nullable<long> JsHeapSize { get; init; }

Property Value#

System.Nullable<System.Int64>

Lcp Property#

Maximum Largest Contentful Paint in milliseconds.

public System.Nullable<double> Lcp { get; init; }

Property Value#

System.Nullable<System.Double>

Ttfb Property#

Maximum Time to First Byte in milliseconds.

public System.Nullable<double> Ttfb { get; init; }

Property Value#

System.Nullable<System.Double>

Methods#

Evaluate(PerformanceMetrics) Method#

Evaluates the budget against collected performance metrics. Metrics that are null (not collected) are skipped. Only configured thresholds are checked.

public Motus.Abstractions.PerformanceBudgetResult Evaluate(Motus.Abstractions.PerformanceMetrics metrics);

Parameters#

metrics PerformanceMetrics

Returns#

PerformanceBudgetResult