metrics

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metrics makes profiling a product feature (ARCHITECTURE.md §14): ScanStats accumulates files walked and skipped, bytes read versus bytes in tree, cache hit rates, per-detector nanoseconds and invocation counts, and the selection explanation of which --select expression enabled which detector (§6.2) — embedded into the Inventory under --stats, so "what did the scanner skip" is always answerable and detector #217 is triaged with data, not guesses. No silent caps: every triage decision leaves a trace.

The package also bootstraps the --pprof server and --trace per-phase regions wired by the composition root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(opts Options) (stop func(), err error)

Bootstrap starts the requested profiling facilities and returns a stop function that shuts them down and flushes the trace. It fails fast (rather than in the background) when the pprof listener cannot bind or the trace file cannot be created, so a mistyped flag never silently no-ops.

Types

type Options

type Options struct {
	PProfAddr string // empty = disabled; CLI defaults the bare flag to localhost:6060
	TraceFile string // empty = disabled
}

Options selects the profiling facilities for one run (docs/cli.md: --pprof, --trace are product features, not test-only).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL