cache: Implement PDH collector (#1662)

This commit is contained in:
Jan-Otto Kröpke
2024-10-03 14:31:44 +02:00
committed by GitHub
parent e6ef2de40c
commit 70156cd106
9 changed files with 410 additions and 54 deletions

View File

@@ -1,6 +1,64 @@
# HELP test_alpha_total Some random metric.
# TYPE test_alpha_total counter
test_alpha_total 42
# HELP windows_cache_async_copy_reads_total (AsyncCopyReadsTotal)
# TYPE windows_cache_async_copy_reads_total counter
# HELP windows_cache_async_data_maps_total (AsyncDataMapsTotal)
# TYPE windows_cache_async_data_maps_total counter
# HELP windows_cache_async_fast_reads_total (AsyncFastReadsTotal)
# TYPE windows_cache_async_fast_reads_total counter
# HELP windows_cache_async_mdl_reads_total (AsyncMDLReadsTotal)
# TYPE windows_cache_async_mdl_reads_total counter
# HELP windows_cache_async_pin_reads_total (AsyncPinReadsTotal)
# TYPE windows_cache_async_pin_reads_total counter
# HELP windows_cache_copy_read_hits_total (CopyReadHitsTotal)
# TYPE windows_cache_copy_read_hits_total gauge
# HELP windows_cache_copy_reads_total (CopyReadsTotal)
# TYPE windows_cache_copy_reads_total counter
# HELP windows_cache_data_flush_pages_total (DataFlushPagesTotal)
# TYPE windows_cache_data_flush_pages_total counter
# HELP windows_cache_data_flushes_total (DataFlushesTotal)
# TYPE windows_cache_data_flushes_total counter
# HELP windows_cache_data_map_hits_percent (DataMapHitsPercent)
# TYPE windows_cache_data_map_hits_percent gauge
# HELP windows_cache_data_map_pins_total (DataMapPinsTotal)
# TYPE windows_cache_data_map_pins_total counter
# HELP windows_cache_data_maps_total (DataMapsTotal)
# TYPE windows_cache_data_maps_total counter
# HELP windows_cache_dirty_page_threshold (DirtyPageThreshold)
# TYPE windows_cache_dirty_page_threshold gauge
# HELP windows_cache_dirty_pages (DirtyPages)
# TYPE windows_cache_dirty_pages gauge
# HELP windows_cache_fast_read_not_possibles_total (FastReadNotPossiblesTotal)
# TYPE windows_cache_fast_read_not_possibles_total counter
# HELP windows_cache_fast_read_resource_misses_total (FastReadResourceMissesTotal)
# TYPE windows_cache_fast_read_resource_misses_total counter
# HELP windows_cache_fast_reads_total (FastReadsTotal)
# TYPE windows_cache_fast_reads_total counter
# HELP windows_cache_lazy_write_flushes_total (LazyWriteFlushesTotal)
# TYPE windows_cache_lazy_write_flushes_total counter
# HELP windows_cache_lazy_write_pages_total (LazyWritePagesTotal)
# TYPE windows_cache_lazy_write_pages_total counter
# HELP windows_cache_mdl_read_hits_total (MDLReadHitsTotal)
# TYPE windows_cache_mdl_read_hits_total counter
# HELP windows_cache_mdl_reads_total (MDLReadsTotal)
# TYPE windows_cache_mdl_reads_total counter
# HELP windows_cache_pin_read_hits_total (PinReadHitsTotal)
# TYPE windows_cache_pin_read_hits_total counter
# HELP windows_cache_pin_reads_total (PinReadsTotal)
# TYPE windows_cache_pin_reads_total counter
# HELP windows_cache_read_aheads_total (ReadAheadsTotal)
# TYPE windows_cache_read_aheads_total counter
# HELP windows_cache_sync_copy_reads_total (SyncCopyReadsTotal)
# TYPE windows_cache_sync_copy_reads_total counter
# HELP windows_cache_sync_data_maps_total (SyncDataMapsTotal)
# TYPE windows_cache_sync_data_maps_total counter
# HELP windows_cache_sync_fast_reads_total (SyncFastReadsTotal)
# TYPE windows_cache_sync_fast_reads_total counter
# HELP windows_cache_sync_mdl_reads_total (SyncMDLReadsTotal)
# TYPE windows_cache_sync_mdl_reads_total counter
# HELP windows_cache_sync_pin_reads_total (SyncPinReadsTotal)
# TYPE windows_cache_sync_pin_reads_total counter
# HELP windows_cpu_clock_interrupts_total Total number of received and serviced clock tick interrupts
# TYPE windows_cpu_clock_interrupts_total counter
# HELP windows_cpu_core_frequency_mhz Core frequency in megahertz
@@ -57,6 +115,7 @@ test_alpha_total 42
# TYPE windows_exporter_collector_duration_seconds gauge
# HELP windows_exporter_collector_success windows_exporter: Whether the collector was successful.
# TYPE windows_exporter_collector_success gauge
windows_exporter_collector_success{collector="cache"} 1
windows_exporter_collector_success{collector="cpu"} 1
windows_exporter_collector_success{collector="cpu_info"} 1
windows_exporter_collector_success{collector="cs"} 1
@@ -73,6 +132,7 @@ windows_exporter_collector_success{collector="system"} 1
windows_exporter_collector_success{collector="textfile"} 1
# HELP windows_exporter_collector_timeout windows_exporter: Whether the collector timed out.
# TYPE windows_exporter_collector_timeout gauge
windows_exporter_collector_timeout{collector="cache"} 0
windows_exporter_collector_timeout{collector="cpu"} 0
windows_exporter_collector_timeout{collector="cpu_info"} 0
windows_exporter_collector_timeout{collector="cs"} 0

View File

@@ -18,14 +18,14 @@ mkdir $textfile_dir | Out-Null
Copy-Item 'e2e-textfile.prom' -Destination "$($textfile_dir)/e2e-textfile.prom"
# Omit dynamic collector information that will change after each run
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_perflib_snapshot_duration_seconds|windows_exporter_scrape_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_logical_disk|windows_physical_disk|windows_memory|windows_net|windows_os|windows_process|windows_service_process|windows_system|windows_perfdata|windows_textfile_mtime_seconds)"
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_perflib_snapshot_duration_seconds|windows_exporter_scrape_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_cache|windows_logical_disk|windows_physical_disk|windows_memory|windows_net|windows_os|windows_process|windows_service_process|windows_system|windows_perfdata|windows_textfile_mtime_seconds)"
# Start process in background, awaiting HTTP requests.
# Use default collectors, port and address: http://localhost:9182/metrics
$exporter_proc = Start-Process `
-PassThru `
-FilePath ..\windows_exporter.exe `
-ArgumentList "--log.level=debug","--web.disable-exporter-metrics","--collectors.enabled=[defaults],cpu_info,textfile,process,perfdata,scheduled_task","--collector.process.include=explorer.exe","--collector.scheduled_task.include=.*WinSAT","--collector.service.include=Themes","--collector.textfile.directories=$($textfile_dir)",@"
-ArgumentList "--log.level=debug","--web.disable-exporter-metrics","--collectors.enabled=[defaults],cache,cpu_info,textfile,process,perfdata,scheduled_task","--collector.process.include=explorer.exe","--collector.scheduled_task.include=.*WinSAT","--collector.service.include=Themes","--collector.textfile.directories=$($textfile_dir)",@"
--collector.perfdata.objects="[{\"object\":\"Processor Information\",\"instance_label\":\"core\",\"instances\":[\"*\"],\"counters\":{\"% Processor Time\":{},\"% Privileged Time\":{}}},{\"object\":\"Memory\",\"counters\":{\"Cache Faults/sec\":{\"type\":\"counter\"}}}]"
"@ `
-WindowStyle Hidden `