recentFor method
Returns recent samples for nodeId, newest first, up to limit.
since bounds the window: only samples captured at or after it are
returned. Applied before limit, so "the last hour" is the last hour and
not the newest limit samples that happen to fall in it.
Implementation
@override
Future<List<MetricSample>> recentFor(
NodeId nodeId, {
int limit = 100,
DateTime? since,
}) async {
final list = _samples[nodeId.value] ?? const [];
final window = since == null
? list.reversed
: list.reversed.where((s) => !s.at.isBefore(since));
return window.take(limit).toList();
}