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
I've noticed that documentation for C# lacks an example for Series.SampleInto method in .NET 8.
Here is an example that uses FuncConvert.FromFunc to convert Func to F#. I think this is somewhat different from older versions of F#/.NET.
This code produces 90 samples every 1 seconds and then sub-samples them every 30 seconds using mean aggregation.
SeriesBuilder<DateTime, double?> data = new SeriesBuilder<DateTime, double?>();
DateTime date = DateTime.UtcNow;
for (int i = 0; i < 90; i++)
{
data.Add(date, Random.Shared.Next(5, 10));
date = date.AddSeconds(1);
}
var fsharp = FuncConvert.FromFunc<Series<DateTime, double?>, object>(x => x.Mean());
Func<DateTime, FSharpFunc<Series<DateTime, double?>, object>> avg = date => fsharp;
var samples = data.Series.SampleInto(TimeSpan.FromSeconds(30), Direction.Forward, avg);
The text was updated successfully, but these errors were encountered:
I've noticed that documentation for C# lacks an example for Series.SampleInto method in .NET 8.
Here is an example that uses FuncConvert.FromFunc to convert Func to F#. I think this is somewhat different from older versions of F#/.NET.
This code produces 90 samples every 1 seconds and then sub-samples them every 30 seconds using mean aggregation.
The text was updated successfully, but these errors were encountered: