Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
added to options
Browse files Browse the repository at this point in the history
  • Loading branch information
Ledjon Behluli authored and Ledjon Behluli committed Dec 28, 2023
1 parent d051462 commit f7e4337
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public sealed class BalancedResourcePlacementOptions
/// </summary>
public TimeSpan ResourceStatisticsCollectionPeriod { get; set; }

/// <summary>
/// If <see langword="true"/>; than an <a href="https://en.wikipedia.org/wiki/Online_algorithm">online</a> 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.
/// </summary>
/// <remarks><i>It is recommended to pick a lower (more frequent) <see cref="ResourceStatisticsCollectionPeriod"/> when adaptiv filtering is used.</i></remarks>
public bool UseAdaptiveFiltering { get; set; }

/// <summary>
/// The importance of the CPU utilization by the silo [percentage].
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Orleans.BalancedResourcePlacement/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions StatisticsFilteringSandbox/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Orleans.BalancedResourcePlacement;

const bool saveResultForPlotting = true;
const int iterations = 250;
const int iterations = 2500;

var filter = new StatisticsFilter<float>();

Expand All @@ -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();

Expand Down

0 comments on commit f7e4337

Please sign in to comment.