mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
feat(perf): explicit toggle for live thread-group CPU polling (#891)
* feat(perf): explicit toggle for live thread-group CPU polling Replace implicit thread-group collection (section open / pin) with a persisted checkbox so Linux /proc scans run only when the user opts in for diagnosis. Fix IPC: pass includeThreadGroups (camelCase) so Tauri maps the flag to Rust; reset the CPU baseline when the option changes so thread % deltas are valid. * docs: CHANGELOG and credits for PR #891 * fix(perf): gate CHILD_RESCAN_EVERY to Linux/macOS only Avoid dead_code warning on Windows where perf child-PID rescan is unused.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { usePerfLiveSnapshot } from '../../../utils/perf/perfLiveStore';
|
||||
import {
|
||||
syncPerfLiveThreadGroupsNeed,
|
||||
} from '../../../utils/perf/perfLivePollSettings';
|
||||
import { usePerfLiveIncludeThreadGroups } from '../../../utils/perf/perfLivePollSettings';
|
||||
import {
|
||||
togglePerfLiveOverlayPin,
|
||||
togglePipelineOverlayPin,
|
||||
@@ -28,13 +26,9 @@ export default function SidebarPerfProbeMonitorTab() {
|
||||
const coverPinned = usePipelineOverlayPinned('pipeline:cover');
|
||||
const cpu = live.cpu;
|
||||
const collecting = live.collecting && cpu == null;
|
||||
const includeThreadGroups = usePerfLiveIncludeThreadGroups();
|
||||
const peakMemoryKbRef = useRef(1);
|
||||
const peakThreadCpuRef = useRef(1);
|
||||
const [threadSectionOpen, setThreadSectionOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
syncPerfLiveThreadGroupsNeed(threadSectionOpen, livePins);
|
||||
}, [threadSectionOpen, livePins]);
|
||||
|
||||
const maxMemoryKb = useMemo(() => {
|
||||
const current = Math.max(1, ...(cpu?.memory.map(m => m.rss_kb) ?? [1]));
|
||||
@@ -123,11 +117,10 @@ export default function SidebarPerfProbeMonitorTab() {
|
||||
/>
|
||||
</PerfProbeMetricSection>
|
||||
|
||||
{(cpu.threadCpu.length > 0 || threadSectionOpen) && (
|
||||
{includeThreadGroups && (
|
||||
<PerfProbeMetricSection
|
||||
title="CPU — psysonic threads"
|
||||
defaultOpen={false}
|
||||
onOpenChange={setThreadSectionOpen}
|
||||
defaultOpen
|
||||
>
|
||||
{cpu.threadCpu.length > 0 ? cpu.threadCpu.map(row => {
|
||||
const pinId = `cpu:thread:${row.label}` as PerfLiveOverlayPinId;
|
||||
@@ -145,7 +138,9 @@ export default function SidebarPerfProbeMonitorTab() {
|
||||
/>
|
||||
);
|
||||
}) : (
|
||||
<div className="perf-monitor-empty perf-monitor-empty--inline">Collecting thread samples…</div>
|
||||
<div className="perf-monitor-empty perf-monitor-empty--inline">
|
||||
No named psysonic threads yet — wait for the next poll or load audio/analysis work.
|
||||
</div>
|
||||
)}
|
||||
</PerfProbeMetricSection>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user