Files
windows_exporter/internal/collector/scheduled_task/AGENTS.md
T
2026-10-09 14:43:42 +02:00

926 B
Raw Blame History

scheduled_task collector

Scrape time is spent waiting on the Task Scheduler service, not on CPU.

  • IRegisteredTask Name and Path are answered locally from the enumerated collection. State, Enabled, LastTaskResult and NumberOfMissedRuns each make a separate RPC to the Schedule service (roughly 0.1–0.3 ms per call). ITaskFolder::GetTasks and GetFolders add one RPC per folder each.
  • Read only the properties that are published, apply the include/exclude filter to the path before any service read, and keep property reads conditional on whether the metric that uses them is emitted.
  • The fake native task in scheduled_task_native_test.go counts reads per vtable slot; extend those assertions when adding a property read.
  • To find slow calls, time each call type over a full enumeration on a live system. Run it as SYSTEM as well as a user: unprivileged accounts see fewer tasks.