@@ -15,8 +15,11 @@ public partial class ResourceMonitoringOptions
15
15
internal const int MaximumSamplingWindow = 900000 ; // 15 minutes.
16
16
internal const int MinimumSamplingPeriod = 1 ;
17
17
internal const int MaximumSamplingPeriod = 900000 ; // 15 minutes.
18
+ internal const int MinimumCachingInterval = 100 ;
19
+ internal const int MaximumCachingInterval = 900000 ; // 15 minutes.
18
20
internal static readonly TimeSpan DefaultCollectionWindow = TimeSpan . FromSeconds ( 5 ) ;
19
21
internal static readonly TimeSpan DefaultSamplingInterval = TimeSpan . FromSeconds ( 1 ) ;
22
+ internal static readonly TimeSpan DefaultRefreshInterval = TimeSpan . FromSeconds ( 5 ) ;
20
23
21
24
/// <summary>
22
25
/// Gets or sets the maximum time window for which utilization can be requested.
@@ -54,4 +57,28 @@ public partial class ResourceMonitoringOptions
54
57
/// </remarks>
55
58
[ TimeSpan ( MinimumSamplingWindow , MaximumSamplingWindow ) ]
56
59
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 ;
57
84
}
0 commit comments