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 Event ¶
type Event uint8
Event is one fixed terminal-pipeline operation.
const ( ModelFrameBuilt Event = iota + 1 ModelFramePublished TerminalViewRendered RowCacheHit RowCacheMiss ContentLinkResolutionRequest ContentLinkResolutionCacheHit SynchronousResolverCall GlobalWorkspaceListRendered GlobalWorkspacePreviewRendered ApplicationViewRendered ProjectWorkspaceViewRendered ProjectSidebarRendered ProjectPreviewComposed ProjectPreviewCacheHit DocumentFrameBuilt DocumentFrameCacheHit DocumentLinkScan DocumentResolutionRequest DocumentResolutionCacheHit RowAnalyzerBypass FilesFrameBuilt FilesFrameCacheHit FilesLinkScan FilesLinkScanCacheHit DeckComposeCacheHit )
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"`
ApplicationViewsRendered uint64 `json:"application_views_rendered"`
ProjectWorkspaceViewsRendered uint64 `json:"project_workspace_views_rendered"`
ProjectSidebarRendered uint64 `json:"project_sidebar_rendered"`
ProjectPreviewComposes uint64 `json:"project_preview_composes"`
ProjectPreviewCacheHits uint64 `json:"project_preview_cache_hits"`
DocumentFramesBuilt uint64 `json:"document_frames_built"`
DocumentFrameCacheHits uint64 `json:"document_frame_cache_hits"`
DocumentLinkScans uint64 `json:"document_link_scans"`
DocumentResolutionRequests uint64 `json:"document_resolution_requests"`
DocumentResolutionCacheHits uint64 `json:"document_resolution_cache_hits"`
RowAnalyzerBypasses uint64 `json:"row_analyzer_bypasses"`
FilesFramesBuilt uint64 `json:"files_frames_built"`
FilesFrameCacheHits uint64 `json:"files_frame_cache_hits"`
FilesLinkScans uint64 `json:"files_link_scans"`
FilesLinkScanCacheHits uint64 `json:"files_link_scan_cache_hits"`
DeckComposeCacheHits uint64 `json:"deck_compose_cache_hits"`
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.