spawnprobe

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package spawnprobe measures fresh-process runtime calls without choosing a host lifetime policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SupervisorBinary string
	Binary           string
	Args             []string
	Samples          int
	Timeout          time.Duration
	WorkspaceID      string
	Revision         string
	Diagnostics      io.Writer
}

Config supplies an explicitly trusted executable and bounded measurement count.

type Measurements

type Measurements struct {
	Operation string      `json:"operation"`
	First     Sample      `json:"first_launch"`
	Warm      []Sample    `json:"warm_samples"`
	Total     Percentiles `json:"total"`
}

Measurements separates a first launch from repeated warm launches.

type Percentiles

type Percentiles struct {
	P50NS int64 `json:"p50_ns"`
	P95NS int64 `json:"p95_ns"`
	P99NS int64 `json:"p99_ns"`
}

Percentiles uses nearest-rank percentiles, preserving individual measurements.

type Report

type Report struct {
	LaunchMode        string       `json:"launch_mode"`
	SupervisorSHA256  string       `json:"supervisor_sha256,omitempty"`
	SchemaVersion     int          `json:"schema_version"`
	GOOS              string       `json:"goos"`
	GOARCH            string       `json:"goarch"`
	GoVersion         string       `json:"go_version"`
	CPUs              int          `json:"cpus"`
	Revision          string       `json:"revision,omitempty"`
	BinarySHA256      string       `json:"binary_sha256"`
	RecordedAt        time.Time    `json:"recorded_at"`
	ColdCacheMeasured bool         `json:"cold_cache_measured"`
	Info              Measurements `json:"info"`
	Find              Measurements `json:"find"`
}

Report contains reproducibility metadata, never executable arguments or environment values.

func Run

func Run(ctx context.Context, config Config) (*Report, error)

Run measures one first launch and Samples warm launches for Info and Find. Building, hashing, and report encoding occur outside the measured operation.

type Sample

type Sample struct {
	PID        int   `json:"pid"`
	Reaped     bool  `json:"reaped"`
	StartupNS  int64 `json:"startup_ns"`
	DispenseNS int64 `json:"dispense_ns"`
	RPCNS      int64 `json:"rpc_ns"`
	ReapNS     int64 `json:"reap_ns"`
	TotalNS    int64 `json:"total_ns"`
}

Sample records wall-clock nanoseconds for one complete plugin operation. PID identifies the direct plugin or, in supervised mode, its owning supervisor.

Jump to

Keyboard shortcuts

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