Documentation
¶
Overview ¶
Package terminalperf exposes privacy-safe counters for the visible terminal pipeline. The hot path records only fixed event kinds: terminal text, paths, targets, session names, and provider payloads cannot enter a probe.
Index ¶
Constants ¶
const SnapshotPath = "/debug/terminalperf"
SnapshotPath is the localhost-only diagnostic route served alongside pprof when SIDECAR_TERMINAL_PERF is enabled by the Sidecar process.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
func Install(counters *Counters) (restore func())
Install routes subsequent events to counters until the returned restore function is called. It is intended for a benchmark, isolated proof, or a production diagnostic owner that can scope the installation.
func Record ¶
func Record(event Event)
Record increments a fixed event counter when a probe is installed.
func RecordOutputToFrame ¶
RecordOutputToFrame records a fixed numeric duration only. Millisecond buckets are enough to decide the 50ms presentation gate without retaining terminal content, targets, or a per-frame timestamp trail.
func SnapshotHandler ¶
SnapshotHandler exposes only the fixed numeric counter vocabulary. It is a read-only development diagnostic, not a product API.
Types ¶
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters is an injectable recorder. It is intentionally data-free apart from counts so enabling it can never retain terminal content or user identity.
type Snapshot ¶
type Snapshot struct {
ModelFramesBuilt uint64 `json:"model_frames_built"`
ModelFramesPublished uint64 `json:"model_frames_published"`
TerminalViewsRendered uint64 `json:"terminal_views_rendered"`
RowCacheHits uint64 `json:"row_cache_hits"`
RowCacheMisses uint64 `json:"row_cache_misses"`
ContentLinkResolutionRequests uint64 `json:"content_link_resolution_requests"`
ContentLinkResolutionCacheHits uint64 `json:"content_link_resolution_cache_hits"`
SynchronousResolverCalls uint64 `json:"synchronous_resolver_calls"`
GlobalWorkspaceListRendered uint64 `json:"global_workspace_list_rendered"`
GlobalWorkspacePreviewRendered uint64 `json:"global_workspace_preview_rendered"`
OutputToFrameSamples uint64 `json:"output_to_frame_samples"`
OutputToFrameP95US uint64 `json:"output_to_frame_p95_us"`
OutputToFrameMaxUS uint64 `json:"output_to_frame_max_us"`
}
Snapshot is a point-in-time copy suitable for benchmark metrics or diagnostics. Field names are the complete diagnostic vocabulary.