Telemetry collection¶
Daemonitor collects operating system metrics and JVM telemetry on separate cadences designed to keep monitoring overhead low even during heavy parallel builds.
Sampling cadences¶
| Collector | Default cadence | Behavior |
|---|---|---|
| Process OS metrics | 2s |
Accelerates to <= 1s (activeInterval) while an observation session or XCODE_BUILD process is active; wakes immediately on POST /v1/sessions |
| Host metrics | 5s |
CPU, memory, swap, load average, plus OS-specific pressure/thermal/PSI/commit |
| JVM heap, GC & advanced probes | 10s cache TTL |
Bounded concurrent pool (ProbeConcurrency = 2, 750ms timeout per probe) |
| Linux PSS & VmHWM | 5s throttle |
Reads /proc/<pid>/smaps_rollup and /proc/<pid>/status |
You can inspect active cadences and self-telemetry from the core via GET /v1/self.
Operating system sampling¶
- Cross-platform OS metrics are collected via
gopsutil(Gocored) or OSHI (Kotlin--jvm-collector). - Platform-specific collectors supplement
gopsutilwhere OS APIs expose richer accounting: - macOS (
cgo):proc_pid_rusage(RUSAGE_INFO_V4)for physical footprint, peak resident bytes, and disk I/O bytes;sysctlbyname/notify_get_statefor host memory pressure and thermal state. - Linux:
/proc/<pid>/smaps_rollup(Pss),/proc/<pid>/status(VmHWM),/proc/<pid>/cgroup(unified cgroup v2), and/proc/pressure/{cpu,memory,io}(PSI). - Windows:
psapi.dll!GetProcessMemoryInfo(PeakWorkingSetSize,PrivateUsage) andkernel32.dll!GlobalMemoryStatusEx(host commit). - CPU percentage: Always computed from the delta of
cpu_total_seconds_totaldivided by elapsed wall-clock time between consecutive samples of the same(pid, createTimeMs). On a process's first poll,cpu_percentisnull(Daemonitor never reports a misleading lifetime average).
JVM telemetry sampling¶
Probe eligibility¶
- Go
daemonitor-cored: ProbesGRADLE_DAEMON,KOTLIN_DAEMON,KOTLIN_TOOLCHAIN,TEST_WORKER,GRADLE_WORKER,UNKNOWN_GRADLE_WORKER, andJAVA_GRADLE_RELATED. ExcludesGRADLE_WRAPPER, allXCODE_*native processes, its own PID, and processes running under a different UID on Unix. - Kotlin
--jvm-collector: ProbesGRADLE_DAEMON,KOTLIN_DAEMON, andKOTLIN_TOOLCHAINvia the JDK Attach API + JMXMemoryMXBean(collecting heap used/committed/max only).
Tool discovery order (daemonitor-cored)¶
For each eligible JVM process, daemonitor-cored locates jcmd, jstat, and jinfo in order:
- Configured
Prober.JDKDir/bin - The target process's own JDK (
TargetJDKDir(pid)/bin) JAVA_HOME/bin- System
PATH
Probe sequence and safety¶
jcmd <pid> GC.heap_info(primary live heap, metaspace, memory pools; falls back tojstat -gc <pid>).jstat -gc <pid>(supplemental GC counts and times:YGC/YGCT,FGC/FGCT,CGC/CGCT,GCT).jcmd <pid> VM.info(active processor count).jinfo -sysprops <pid>(strictly allowlisted keys only:java_version,java_runtime_version,java_vendor,java_vm_name,java_vm_version,os_name,os_arch—the full property map is never stored or logged).- Advanced telemetry (enabled by default):
jstat -compiler,jstat -class,jcmd Compiler.codecache, andjcmd PerfCounter.print.
If any probe fails, Daemonitor records a sanitized diagnostic category (missing_tool, timeout, permission_denied, stale_pid, parse_error, unsupported_jdk, probe_error) without exposing raw stdout/stderr or sensitive system properties.