Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ When enabled, press `Cmd+Shift+M` to toggle the metrics overlay in the bottom-ri
- **Frames**: Total rendered frame count
- **FPS**: Frames per second
- **Glyph cache**: Number of cached glyph textures
- **Glyph hit rate**: Cache hit percentage (hits / total accesses)
- **Glyph hits/s**: Glyph cache hits per second
- **Glyph misses/s**: Glyph cache misses per second
- **Glyph evictions/s**: Glyph cache evictions per second
Expand Down
5 changes: 5 additions & 0 deletions src/ui/components/metrics_overlay.zig
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ pub const MetricsOverlayComponent = struct {
lines[line_count] = std.fmt.bufPrint(&line_bufs[line_count], "Glyph cache: {d}", .{cache_size}) catch "Glyph cache: ?";
line_count += 1;

const total_accesses = hit_rate + miss_rate;
const hit_pct: f64 = if (total_accesses > 0) (hit_rate / total_accesses) * 100.0 else 0.0;
lines[line_count] = std.fmt.bufPrint(&line_bufs[line_count], "Glyph hit rate: {d:.1}%", .{hit_pct}) catch "Glyph hit rate: ?";
line_count += 1;

lines[line_count] = std.fmt.bufPrint(&line_bufs[line_count], "Glyph hits/s: {d:.1}", .{hit_rate}) catch "Glyph hits/s: ?";
line_count += 1;

Expand Down