Commit Graph
133 Commits
Author SHA1 Message Date
Tunglies 2f370d6490 refactor(log): in-place writer lifecycle and span-based core observability (#7889)
* refactor(log): migrate logging to tracing-estuary pipeline

Swap flexi_logger + clash-verge-logger wiring for the tracing-estuary
crate: buffered file sink with explicit panic/exit drains, live level
switching, and tokio-trace/chrome-trace behind crate features.

AsyncLogger moves in-house (VecDeque ring); file format and rotation
stay unchanged.

* fix(log): reset sidecar writer in place and re-pin service-ipc v2.6.7

Rebuilding the sidecar FileLogWriter on config changes leaked flexi's
unstoppable flusher thread plus an fd each time; the writer is now flushed
and reset in place, matching what the service crate does.
get_clash_logs_by_service drops the CompactString conversion layer now that
service-ipc v2.6.7 returns plain Vec<String>, and AsyncLogger is renamed
LogRing to match.

* refactor(log): span-based observability and log noise cleanup

Instrument spans carry the structure flat lines never could: the core-start
spine (mode, readiness/owner generations, pid, config file), proxy apply and
clear routes with guard generations, service IPC sessions with refusal codes
and outcomes, profile-switch terminal outcomes, subscription fetch strategies,
core upgrades with per-proxy version probes, backup flows, timer tasks, config
generation uids, and the startup setup flow; running-mode changes emit one
guarded transition event each.
~90 hand-written noise lines are gone or demoted (entry+success pairs, polled
getter echoes, phase brackets, window sub-steps, platform install chatter);
errors keep their anyhow chain, operation name, and item id, and swallowed
retry results surface per attempt.
2026-09-08 05:51:04 +08:00
Tunglies b39c5f9b6d test(perf): add macOS Tauri WebView performance harness
Drive the production home traffic graph through embedded WebDriver in an
isolated optimized measurement build. Record attributed WebContent and main
process CPU/RSS distributions across foreground, hidden and restored phases.

Keep replay, raw reports, independent-run comparison, cleanup checks and
focused validation available through project commands. Normal release builds
exclude the automation service and measurement entry points.
2026-09-07 07:13:24 +08:00
wonfen 4869e362e3 fix: report fatal singleton startup errors 2026-08-17 07:18:34 +08:00
Tunglies 8ccb0b9abd perf: reduce tokio runtime thread limits
The Tauri backend is primarily the control plane for IPC, config generation, tray/window events, and mihomo API calls. The proxy data plane runs in the mihomo sidecar/service process, so allowing up to 16 runtime workers adds scheduling headroom without clear startup benefit.

Setup benchmark used isolated HOME/XDG dirs, isolated mihomo IPC sockets, sidecar mode, disabled TUN/system proxy defaults, and graceful shutdown after setup on an 18-thread host.

| limit | workers | blocking | setup async avg/max | avg threads |
| --- | ---: | ---: | ---: | ---: |
| old | 16 | 64 | 742.2ms / 1163.4ms | 34.5 |
| old | 8 | 32 | 650.8ms / 680.9ms | 27.0 |
| old | 4 | 16 | 681.5ms / 708.1ms | 23.8 |
| new | 16 | 32 | 682.8ms / 747.0ms | 35.3 |
| new | 8 | 16 | 650.1ms / 662.4ms | 26.0 |
| new | 4 | 8 | 639.3ms / 645.5ms | 22.1 |

The 2x blocking pool reduced tail latency across the tested limits. Capping workers at 8 keeps enough concurrency for normal control-plane work while avoiding the 16-worker tail-latency outlier and reducing blocking-pool headroom from 64 to 16 on this host.
2026-05-25 17:24:06 +08:00
Tunglies 30ed2ac829 feat(runtime): cap tokio worker threads at 16 and scale blocking threads (#6261)
This prevents the runtime from spawning an excessive number of threads on
high-end CPUs, reducing memory footprint and context switching.
Introduces a dynamic cap for worker threads (max 16) and scales
blocking threads proportionally. Includes thread naming for diagnostics.
2026-04-15 08:38:19 +00:00
Slinetrac 4ab2720ac4 refactor(tray): remove --no-tray code path and env-based tray bypass 2025-12-25 10:42:03 +08:00
Tunglies aaf3ebe547 refactor: enhance error handling in Timer and update server argument collection 2025-11-06 10:42:21 +08:00
Tunglies d3d32006c3 feat: add logging check to pre-commit and CI workflow 2025-11-01 21:22:41 +08:00
Tunglies 924e7d1022 Refactor string handling to use into() instead of to_string() for improved performance and consistency across the codebase. This change affects various modules including app.rs, clash.rs, config.rs, core.rs, service.rs, and others, ensuring that string conversions are streamlined and more idiomatic. 2025-10-14 09:26:20 +08:00
Sline d3477159a8 fix: improve Linux tray support and add --no-tray option (#4958) 2025-10-07 10:02:11 +08:00
Tunglies f0dbe9fa60 feat: add console-subscriber for improved logging and tracing support 2025-08-18 23:40:25 +08:00
huzibaca a398e28ac0 chore: follow official standards and adjust the main file 2024-09-15 06:24:53 +08:00
huzibaca 1b2509d5bc refactor: url scheme implementation 2024-09-13 03:21:55 +08:00
huzibaca 07de032e62 feat: migrate tauri 2.0 2024-09-11 08:15:03 +08:00
huzibaca 6cc81fe6b8 chore: update 2024-09-02 19:33:17 +08:00
MystiPanda 57fa48aef4 feat: display network interface 2024-07-13 14:15:13 +08:00
Avan 5a8e0749c2 feature: copy clash env (#1391)
* feat: copy clash env

* style: use ContentCopyRounded replace CopyAll
2024-07-13 01:03:46 +08:00
MystiPanda a865465514 feat: get network interface 2024-07-07 18:13:10 +08:00
MystiPanda b85929772e refactor: use async instead of block_on 2024-06-29 19:02:37 +08:00
MystiPanda 9a04208a11 Revert "feat: disable running with admin permission and check service mode"
This reverts commit 481e473b60.
2024-06-16 12:06:23 +08:00
MystiPanda 481e473b60 feat: disable running with admin permission and check service mode 2024-06-14 23:15:49 +08:00
MystiPanda a20d4959bf refactor: remove grant logic 2024-06-13 16:07:56 +08:00
MystiPanda b9ec94d835 feat: Support PAC Mode 2024-05-26 17:59:39 +08:00
MystiPanda 1180a4fb0b fix: try to set env 2024-05-03 18:00:55 +08:00
MystiPanda daf726ebbf feat: Try to cache remote images
#603
2024-03-15 16:43:39 +08:00
MystiPanda d214c8e01b feat: Allow open devtools 2024-03-11 20:19:21 +08:00
MystiPanda c2852c8a82 refactor: Optimize implementation of Custom tray icon 2024-02-24 11:25:22 +08:00
MystiPanda 655ccba89b fix: prevent_exit 2024-02-02 17:26:31 +08:00
MystiPanda 6a316b34a2 fix: exit_app event 2024-02-02 16:32:19 +08:00
MystiPanda 5630a4dd67 chore: Remove prevent_close 2024-02-02 15:57:03 +08:00
MystiPanda b6f4695bcd feat: Add Test Page 2024-01-17 11:02:17 +08:00
MystiPanda 8fc4b338c2 Revert Use Tauri Websocket 2024-01-15 10:17:00 +08:00
MystiPanda 71103bb7b9 refactor: Use Tauri WebSocket 2024-01-14 17:30:18 +08:00
MystiPanda 3a883b9e41 refactor: cargo clippy 2024-01-10 17:36:35 +08:00
MystiPanda 981f9d0b01 fix: portable flag 2023-12-15 21:39:34 +08:00
MystiPanda 16fa2c9f5e fix: Save wrong window size 2023-12-12 16:42:19 +08:00
MystiPanda feac8085c9 fix: Stop core before install update 2023-12-05 15:01:15 +08:00
Pylogmon 0775560ad2 feat: Support Drag to Reorder the Profile (#29)
* feat: Support Drag to Reorder the Profile

* style: Remove unnecessary styles
2023-11-29 08:54:02 +08:00
Kuingsmile 72300fec5e feat: add UWP loopback tools 2023-11-22 00:15:41 -08:00
GyDi 69b9944b8e feat: increase the concurrency of latency test 2023-11-01 20:52:38 +08:00
GyDi cfce6d548b fix: save window size and pos in Windows 2023-07-22 13:13:16 +08:00
GyDi 038e93ea6a feat: save window size and position 2023-07-22 10:58:16 +08:00
GyDi 9e2812d55c feat: support to grant permission to clash core 2023-03-16 11:16:54 +08:00
GyDi 36a53f8134 feat: support to open core dir 2022-12-13 00:44:24 +08:00
GyDi bedd3abf8a refactor: done 2022-11-18 18:18:41 +08:00
GyDi bb669acf95 refactor: rm dead code 2022-11-17 22:52:22 +08:00
GyDi 4f3751b7ce refactor: for windows 2022-11-17 20:19:40 +08:00
GyDi 84c12dee80 refactor: wip 2022-11-17 17:07:13 +08:00
GyDi d566629d51 refactor: fix 2022-11-14 01:45:58 +08:00
GyDi 837422fbb8 refactor: wip 2022-11-14 01:26:33 +08:00