feat(scanner): add scanner budget progress controls (#3185)

Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
This commit is contained in:
Henry Guo
2026-06-03 22:37:58 +08:00
committed by GitHub
parent f49827fc58
commit ad1a489f75
13 changed files with 1346 additions and 189 deletions
@@ -279,6 +279,13 @@ pub enum MetricName {
ScannerVersionsScanned,
ScannerLastActivitySeconds,
ScannerActivePaths,
ScannerOldestActivePathAgeSeconds,
ScannerCurrentSetScanConcurrencyLimit,
ScannerCurrentSetScansQueued,
ScannerCurrentSetScansActive,
ScannerCurrentDiskScanConcurrencyLimit,
ScannerCurrentDiskBucketScansQueued,
ScannerCurrentDiskBucketScansActive,
ScannerBucketScansFailed,
ScannerThrottleIdleModeEnabled,
ScannerThrottleSleepFactor,
@@ -286,6 +293,8 @@ pub enum MetricName {
ScannerYieldEveryNObjects,
ScannerCycleIntervalSeconds,
ScannerCycleMaxDurationSeconds,
ScannerCycleMaxObjects,
ScannerCycleMaxDirectories,
ScannerBitrotCycleEnabled,
ScannerBitrotCycleSeconds,
ScannerCurrentCycle,
@@ -308,6 +317,7 @@ pub enum MetricName {
ScannerCurrentCycleUsageSaves,
ScannerCurrentScanMode,
ScannerLastCycleResult,
ScannerLastCyclePartialReason,
ScannerLastCycleDurationSeconds,
ScannerLastCycleObjectsScanned,
ScannerLastCycleDirectoriesScanned,
@@ -326,6 +336,7 @@ pub enum MetricName {
ScannerLastCycleUsageSaves,
ScannerFailedCycles,
ScannerPartialCycles,
ScannerPartialCyclesByReason,
// CPU system-related metrics
SysCPUAvgIdle,
@@ -667,6 +678,13 @@ impl MetricName {
Self::ScannerVersionsScanned => "versions_scanned".to_string(),
Self::ScannerLastActivitySeconds => "last_activity_seconds".to_string(),
Self::ScannerActivePaths => "active_paths".to_string(),
Self::ScannerOldestActivePathAgeSeconds => "oldest_active_path_age_seconds".to_string(),
Self::ScannerCurrentSetScanConcurrencyLimit => "current_set_scan_concurrency_limit".to_string(),
Self::ScannerCurrentSetScansQueued => "current_set_scans_queued".to_string(),
Self::ScannerCurrentSetScansActive => "current_set_scans_active".to_string(),
Self::ScannerCurrentDiskScanConcurrencyLimit => "current_disk_scan_concurrency_limit".to_string(),
Self::ScannerCurrentDiskBucketScansQueued => "current_disk_bucket_scans_queued".to_string(),
Self::ScannerCurrentDiskBucketScansActive => "current_disk_bucket_scans_active".to_string(),
Self::ScannerBucketScansFailed => "bucket_scans_failed".to_string(),
Self::ScannerThrottleIdleModeEnabled => "throttle_idle_mode_enabled".to_string(),
Self::ScannerThrottleSleepFactor => "throttle_sleep_factor".to_string(),
@@ -674,6 +692,8 @@ impl MetricName {
Self::ScannerYieldEveryNObjects => "yield_every_n_objects".to_string(),
Self::ScannerCycleIntervalSeconds => "cycle_interval_seconds".to_string(),
Self::ScannerCycleMaxDurationSeconds => "cycle_max_duration_seconds".to_string(),
Self::ScannerCycleMaxObjects => "cycle_max_objects".to_string(),
Self::ScannerCycleMaxDirectories => "cycle_max_directories".to_string(),
Self::ScannerBitrotCycleEnabled => "bitrot_cycle_enabled".to_string(),
Self::ScannerBitrotCycleSeconds => "bitrot_cycle_seconds".to_string(),
Self::ScannerCurrentCycle => "current_cycle".to_string(),
@@ -696,6 +716,7 @@ impl MetricName {
Self::ScannerCurrentCycleUsageSaves => "current_cycle_usage_saves".to_string(),
Self::ScannerCurrentScanMode => "current_scan_mode".to_string(),
Self::ScannerLastCycleResult => "last_cycle_result".to_string(),
Self::ScannerLastCyclePartialReason => "last_cycle_partial_reason".to_string(),
Self::ScannerLastCycleDurationSeconds => "last_cycle_duration_seconds".to_string(),
Self::ScannerLastCycleObjectsScanned => "last_cycle_objects_scanned".to_string(),
Self::ScannerLastCycleDirectoriesScanned => "last_cycle_directories_scanned".to_string(),
@@ -714,6 +735,7 @@ impl MetricName {
Self::ScannerLastCycleUsageSaves => "last_cycle_usage_saves".to_string(),
Self::ScannerFailedCycles => "failed_cycles".to_string(),
Self::ScannerPartialCycles => "partial_cycles".to_string(),
Self::ScannerPartialCyclesByReason => "partial_cycles_by_reason".to_string(),
// CPU system-related metrics
Self::SysCPUAvgIdle => "avg_idle".to_string(),