withMetrics method
Returns a copy with the metrics of the window ending at metricsUntil.
Unlike copyWith, a null series replaces the current one, so a panel whose metrics could not be fetched shows as unavailable instead of showing samples from an older window.
Implementation
TopSnapshot withMetrics({
required final List<PodResourceSeries>? podResources,
required final CapsuleNetworkSeries? network,
required final DatabaseMetrics? database,
required final DateTime metricsUntil,
}) {
return TopSnapshot(
runtime: runtime,
updatedAt: updatedAt,
deployments: deployments,
podResources: podResources,
network: network,
database: database,
metricsUntil: metricsUntil,
logs: logs,
isStatusStale: isStatusStale,
);
}