@@ -15,8 +15,11 @@ public partial class ResourceMonitoringOptions
1515 internal const int MaximumSamplingWindow = 900000 ; // 15 minutes.
1616 internal const int MinimumSamplingPeriod = 1 ;
1717 internal const int MaximumSamplingPeriod = 900000 ; // 15 minutes.
18+ internal const int MinimumCachingInterval = 100 ;
19+ internal const int MaximumCachingInterval = 900000 ; // 15 minutes.
1820 internal static readonly TimeSpan DefaultCollectionWindow = TimeSpan . FromSeconds ( 5 ) ;
1921 internal static readonly TimeSpan DefaultSamplingInterval = TimeSpan . FromSeconds ( 1 ) ;
22+ internal static readonly TimeSpan DefaultRefreshInterval = TimeSpan . FromSeconds ( 5 ) ;
2023
2124 /// <summary>
2225 /// Gets or sets the maximum time window for which utilization can be requested.
@@ -54,4 +57,28 @@ public partial class ResourceMonitoringOptions
5457 /// </remarks>
5558 [ TimeSpan ( MinimumSamplingWindow , MaximumSamplingWindow ) ]
5659 public TimeSpan PublishingWindow { get ; set ; } = DefaultCollectionWindow ;
60+
61+ /// <summary>
62+ /// Gets or sets the default interval used for refreshing values reported by <c>"process.cpu.utilization"</c> metrics.
63+ /// </summary>
64+ /// <value>
65+ /// The default value is 5 seconds.
66+ /// </value>
67+ /// <remarks>
68+ /// This is the time interval for a metric value to fetch resource utilization data from the operating system.
69+ /// </remarks>
70+ [ TimeSpan ( MinimumCachingInterval , MaximumCachingInterval ) ]
71+ public TimeSpan CpuConsumptionRefreshInterval { get ; set ; } = DefaultRefreshInterval ;
72+
73+ /// <summary>
74+ /// Gets or sets the default interval used for refreshing values reported by <c>"dotnet.process.memory.virtual.utilization"</c> metrics.
75+ /// </summary>
76+ /// <value>
77+ /// The default value is 5 seconds.
78+ /// </value>
79+ /// <remarks>
80+ /// This is the time interval for a metric value to fetch resource utilization data from the operating system.
81+ /// </remarks>
82+ [ TimeSpan ( MinimumCachingInterval , MaximumCachingInterval ) ]
83+ public TimeSpan MemoryConsumptionRefreshInterval { get ; set ; } = DefaultRefreshInterval ;
5784}
0 commit comments