From c412c25fcae3fba2201e8e3222def84de9847d84 Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Sat, 1 Oct 2022 23:04:52 +0100 Subject: [PATCH] beginning resamplings with 0 for better graphing --- Selector/Scrobble/Resampler.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Selector/Scrobble/Resampler.cs b/Selector/Scrobble/Resampler.cs index bfbc60d..254639b 100644 --- a/Selector/Scrobble/Resampler.cs +++ b/Selector/Scrobble/Resampler.cs @@ -20,13 +20,19 @@ namespace Selector yield break; } - var sortedScrobblesIter = sortedScrobbles.GetEnumerator(); + var sortedScrobblesIter = sortedScrobbles.GetEnumerator(); sortedScrobblesIter.MoveNext(); var earliest = sortedScrobbles.First().Timestamp; var latest = sortedScrobbles.Last().Timestamp; - var enumeratorExhausted = false; + yield return new CountSample() + { + TimeStamp = earliest - (window / 2), + Value = 0 + }; + + var enumeratorExhausted = false; for (var windowStart = earliest; windowStart <= latest; windowStart += window) {