diff --git a/Orleans.BalancedResourcePlacement/BalancedResourcePlacementStrategy.cs b/Orleans.BalancedResourcePlacement/BalancedResourcePlacementStrategy.cs index a314ff7..6af096c 100644 --- a/Orleans.BalancedResourcePlacement/BalancedResourcePlacementStrategy.cs +++ b/Orleans.BalancedResourcePlacement/BalancedResourcePlacementStrategy.cs @@ -45,6 +45,14 @@ public sealed class BalancedResourcePlacementOptions /// public TimeSpan ResourceStatisticsCollectionPeriod { get; set; } + /// + /// If ; than an online adaptive filter is used to + /// filter out high-frequency components (provides smoothing) and avoid rapid signal drops by translating it into a more linear decay process. + /// This all contributes to avoid resource saturation on the silos. + /// + /// It is recommended to pick a lower (more frequent) when adaptiv filtering is used. + public bool UseAdaptiveFiltering { get; set; } + /// /// The importance of the CPU utilization by the silo [percentage]. /// diff --git a/Orleans.BalancedResourcePlacement/Extensions.cs b/Orleans.BalancedResourcePlacement/Extensions.cs index 394b8d5..cacfc0d 100644 --- a/Orleans.BalancedResourcePlacement/Extensions.cs +++ b/Orleans.BalancedResourcePlacement/Extensions.cs @@ -18,7 +18,7 @@ public static ISiloBuilder AddBalancedResourcePlacement(this ISiloBuilder siloBu { BalancedResourcePlacementOptions options = new() { - ResourceStatisticsCollectionPeriod = TimeSpan.FromSeconds(5), + ResourceStatisticsCollectionPeriod = TimeSpan.FromSeconds(1), CpuUsageWeight = 0.3f, AvailableMemoryWeight = 0.4f, MemoryUsageWeight = 0.2f, diff --git a/StatisticsFilteringSandbox/Program.cs b/StatisticsFilteringSandbox/Program.cs index a498c45..d43674f 100644 --- a/StatisticsFilteringSandbox/Program.cs +++ b/StatisticsFilteringSandbox/Program.cs @@ -3,7 +3,7 @@ using Orleans.BalancedResourcePlacement; const bool saveResultForPlotting = true; -const int iterations = 250; +const int iterations = 2500; var filter = new StatisticsFilter(); @@ -13,10 +13,10 @@ bool _1stFlag = false; bool _2ndFlag = false; List<(int, int)> trafficHours = - [(0, 1), (16, 24), (39, 40)]; + //[(0, 1), (16, 24), (39, 40)]; //[(0, 8), (20, 21), (40, 48)]; //[(0, 2), (6, 8), (12, 14), (18, 22)]; - //[(0, 2), (4, 6), (8, 10), (12, 14), (16, 18), (20, 22)]; + [(0, 2), (4, 6), (8, 10), (12, 14), (16, 18), (20, 22)]; //[(0, 1), (3, 4), (6, 7), (9, 10), (12, 13), (15, 16), (18, 19), (21, 22), (24, 25), (27, 28), (30, 31), (33, 34), (36, 37), (39, 40), (42, 43), (45, 46), (48, 49)]; int maxHour = trafficHours.SelectMany(pair => new[] { pair.Item1, pair.Item2 }).Max();