You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var histogram = new LongHistogram(TimeSpan.FromMinutes(40).Ticks, 4);
var maxValue = TimeSpan.FromMinutes(20).Ticks;
var count = 10000;
for (var i = 0; i < count; i++)
{
histogram.RecordValue(Random.Shared.NextInt64(maxValue));
}
await using var ms = new MemoryStream();
HistogramLogWriter.Write(ms, DateTimeOffset.FromUnixTimeMilliseconds(histogram.StartTimeStamp).UtcDateTime, histogram);
ms.Position = 0;
var readBackHistograms = new HistogramLogReader(ms).ReadHistograms().ToList();
When count is 10000 or more, the last line consistently throws the following exception:
System.ArgumentException: 'The buffer does not contain the indicated payload amount'
But when count is set to 9000, it runs successfully without issue.