Documentation
¶
Index ¶
- func AddBenchStats(ctx context.Context, repoPath string, stats BenchStats)
- func BenchEnabled(repoPath string) bool
- func BenchLogPath(repoPath string) string
- func Diff(after, before map[string]BenchStats) map[string]BenchStats
- func EmitBenchRecord(repoPath string, record BenchRecord)
- func Milliseconds(d time.Duration) int64
- type BenchRecord
- type BenchScope
- type BenchStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBenchStats ¶
func AddBenchStats(ctx context.Context, repoPath string, stats BenchStats)
AddBenchStats merges repo-local stats into the current scope, if present.
func BenchEnabled ¶
BenchEnabled returns true when doctor bench recording is enabled for a repo.
func BenchLogPath ¶
BenchLogPath returns the per-repo JSONL output path for doctor bench.
func Diff ¶
func Diff(after, before map[string]BenchStats) map[string]BenchStats
Diff subtracts one snapshot from another.
func EmitBenchRecord ¶
func EmitBenchRecord(repoPath string, record BenchRecord)
EmitBenchRecord appends one JSONL record for the given repo when doctor bench is enabled.
func Milliseconds ¶
Milliseconds converts a duration into integer milliseconds.
Types ¶
type BenchRecord ¶
type BenchRecord struct {
TS string `json:"ts"`
Kind string `json:"kind"`
Event string `json:"event,omitempty"`
Tool string `json:"tool,omitempty"`
TurnID string `json:"turn_id,omitempty"`
DurationMS int64 `json:"duration_ms,omitempty"`
DBMS int64 `json:"db_ms,omitempty"`
BlobMS int64 `json:"blob_ms,omitempty"`
RSSMB int64 `json:"rss_mb,omitempty"`
CaptureMS int64 `json:"capture_ms,omitempty"`
PackageMS int64 `json:"package_ms,omitempty"`
RowsWritten int `json:"rows_written,omitempty"`
BlobsWritten int `json:"blobs_written,omitempty"`
BytesWritten int64 `json:"bytes_written,omitempty"`
}
BenchRecord is the JSONL payload written by the doctor bench recorder.
type BenchScope ¶
type BenchScope struct {
// contains filtered or unexported fields
}
BenchScope aggregates per-repo stats while one hook or turn is being handled.
func WithBenchScope ¶
func WithBenchScope(ctx context.Context) (context.Context, *BenchScope)
WithBenchScope attaches a new aggregation scope to the context.
func (*BenchScope) Snapshot ¶
func (s *BenchScope) Snapshot() map[string]BenchStats
Snapshot returns a copy of the current per-repo stats.