Files
VoelinClient/crates/voelin-gpui/Cargo.toml
T
faumarayandClaude Sonnet 5.5 109e1d1839 voelin-gpui: the cost meter as a development switch (VOELIN_METER=1), logged once a second
meter.rs is spike_common::meter of the GPUI spikes
(spikes/gpui/common/src/meter.rs, docs/design/gpui-spikes.md) without the
measuring run's summary and exit: once a second, on a thread of its own, a
log line (target voelin_gpui::meter, level info) with the process's CPU in
percent of one core, the resident memory, the CPU of each group of threads
(a thread's name without its trailing number: `llvmpipe-12` is `llvmpipe`,
which tells the software renderer's share, work a GPU would take, from
GPUI's thread, the engine's runtime and the codecs; the busiest first, groups
under 0.5 % left out), the app's own counters per second and the voice
connections as a gauge:

  cpu 11.9% rss 250.4 MiB | threads llvmpipe 5.9 voelin-gpui 5.0 |
  engine_events 0.0/s ticks 1.0/s renders 1.0/s later_jobs 0.0/s | connections 0

The counters (`Counters`: engine events handled, ticks, renders, jobs run
through `Later`, connections up) are shared with the root state and the main
view, which count in `handle_event`, `tick`, the later task and `render`; the
numbers come from /proc/self (a note and a warning say so where there is none;
rustix's `param` for the page size and the clock tick, Linux only, no new
package: the lock gains the edge). The line is a pure function with a test,
as are the thread grouping and the stat parser (a name with spaces and
parentheses), and one test reads this process and checks it has threads and
memory. The root state's tests now also check the counters (events, the
connection gauge, three ticks, a job from another thread).

`VOELIN_METER=1` starts it (dev.rs parses it with the other switches).
Running the debug binary on the swatch page on Xvfb :97 logs the lines above
(about 12 % of a core when idle, the software renderer 6 to 11 % of it, one
frame a second); the window closes with exit code 0. The default log filter
now leaves out GPUI's "failed to load font .SystemUIFont" warning, which
every start printed (gpui-component asks for the platform UI font before the
theme names Inter; the text system falls back).

Checked on Rust 1.95.0: fmt, clippy -D warnings --no-deps (all targets),
`cargo test -p voelin-gpui` (30 tests), cargo deny, `scripts/notices.sh
--check`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 07:12:56 +03:00

54 lines
2.2 KiB
TOML

[package]
name = "voelin-gpui"
version = "0.0.1-alpha"
description = "The GPUI front end of the desktop app, under construction: it runs on the same engine as the Slint front end (voelin-ui) until it reaches parity."
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
[lib]
name = "voelin_gpui"
path = "src/lib.rs"
[[bin]]
name = "voelin-gpui"
path = "src/main.rs"
[dependencies]
anyhow = "1.0.104"
# GPUI, gpui-component and gpui-kit-assets behind one pinned dependency.
gpui-kit = { workspace = true }
# The engine's runtime and the channel of its events (a tokio receiver needs no
# reactor, so GPUI's executor can await it).
tokio = { version = "1.53.1", features = ["rt-multi-thread", "sync", "time"] }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
# The engine, with the desktop's capture and codecs: ashpd on async-io (the
# commit that moved voelin-media and voelin-platform to it) lets this binary
# hold both the portals and gpui-kit.
voelin-core = { path = "../voelin-core", default-features = false, features = ["audio-device", "media-desktop"] }
# The app's name and id, the hotkeys and portals of the slices to come.
voelin-platform = { path = "../voelin-platform" }
# The Host trait's types (what the store knows of a chat's read marker).
voelin-store = { path = "../voelin-store" }
# The view models and the state, shared with the Slint front end.
voelin-ui-vm = { path = "../voelin-ui-vm" }
# The meter reads /proc/self (CPU ticks per second, the page size).
[target.'cfg(target_os = "linux")'.dependencies]
rustix = { version = "1.1.5", features = ["param"] }
[dev-dependencies]
# GPUI's test platform (`#[gpui::test]`, `TestAppContext`): the front end's tests
# need no display. gpui-kit's own `test-support` feature is not used: it names
# the optional `gpui-fast` backend in weak features, which puts gpui-fast and
# its tree into Cargo.lock and pins taffy to 0.15.0 for every build. gpui-kit
# pins `gpui-pre` exactly, so this line moves with its `=` pin (a mismatch does
# not resolve).
gpui = { package = "gpui-pre", version = "=0.3.10", features = ["test-support"] }
[lints]
workspace = true