copyWith method
Creates a copy of stats with updated metrics.
latencyMs: The primary representative latency.jitterMs: Calculated variance between samples.packetLossPercent: % of failed probes.stabilityScore: Overall health score (0-100).
Implementation
LatencyStats copyWith({
BigInt? latencyMs,
BigInt? jitterMs,
double? packetLossPercent,
BigInt? minLatencyMs,
BigInt? avgLatencyMs,
BigInt? maxLatencyMs,
int? stabilityScore,
}) {
return LatencyStats(
latencyMs: latencyMs ?? this.latencyMs,
jitterMs: jitterMs ?? this.jitterMs,
packetLossPercent: packetLossPercent ?? this.packetLossPercent,
minLatencyMs: minLatencyMs ?? this.minLatencyMs,
avgLatencyMs: avgLatencyMs ?? this.avgLatencyMs,
maxLatencyMs: maxLatencyMs ?? this.maxLatencyMs,
stabilityScore: stabilityScore ?? this.stabilityScore,
);
}