Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ public partial class ResourceMonitoringOptions
internal const int MaximumSamplingWindow = 900000; // 15 minutes.
internal const int MinimumSamplingPeriod = 1;
internal const int MaximumSamplingPeriod = 900000; // 15 minutes.
internal const int MinimumCachingInterval = 100;
internal const int MaximumCachingInterval = 900000; // 15 minutes.
internal static readonly TimeSpan DefaultCollectionWindow = TimeSpan.FromSeconds(5);
internal static readonly TimeSpan DefaultSamplingInterval = TimeSpan.FromSeconds(1);
internal static readonly TimeSpan DefaultRefreshInterval = TimeSpan.FromSeconds(5);

/// <summary>
/// Gets or sets the maximum time window for which utilization can be requested.
Expand Down Expand Up @@ -54,4 +57,28 @@ public partial class ResourceMonitoringOptions
/// </remarks>
[TimeSpan(MinimumSamplingWindow, MaximumSamplingWindow)]
public TimeSpan PublishingWindow { get; set; } = DefaultCollectionWindow;

/// <summary>
/// Gets or sets the default interval used for refreshing values reported by <c>"process.cpu.utilization"</c> metrics.
/// </summary>
/// <value>
/// The default value is 5 seconds.
/// </value>
/// <remarks>
/// This is the time interval for a metric value to fetch resource utilization data from the operating system.
/// </remarks>
[TimeSpan(MinimumCachingInterval, MaximumCachingInterval)]
public TimeSpan CpuConsumptionRefreshInterval { get; set; } = DefaultRefreshInterval;

/// <summary>
/// Gets or sets the default interval used for refreshing values reported by <c>"dotnet.process.memory.virtual.utilization"</c> metrics.
/// </summary>
/// <value>
/// The default value is 5 seconds.
/// </value>
/// <remarks>
/// This is the time interval for a metric value to fetch resource utilization data from the operating system.
/// </remarks>
[TimeSpan(MinimumCachingInterval, MaximumCachingInterval)]
public TimeSpan MemoryConsumptionRefreshInterval { get; set; } = DefaultRefreshInterval;
}
Loading