Documentation
¶
Index ¶
- Constants
- type BridgeControlSource
- type BridgeProbe
- type DeadEntityProbe
- type DeadEntitySource
- type DeadEntityWorkspaceSource
- type Probe
- type ProbeEnv
- type ProbeFunc
- type Registry
- type RunOptions
- type Runner
- type RuntimeMemoryProbe
- type RuntimeMemorySnapshot
- type RuntimeMemorySnapshotSource
- type SubprocessHealthProbe
- type SubprocessHealthSnapshotSource
Constants ¶
const RuntimeMemoryProbeID = "runtime.memory"
const (
SubprocessHealthProbeID = "runtime.subprocess_health"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeControlSource ¶
type BridgeControlSource interface {
ListInstances(context.Context) ([]bridgepkg.BridgeInstance, error)
CheckBridge(
context.Context,
string,
bridgepkg.BridgeCheckRequest,
) (bridgepkg.BridgeCheckResponse, error)
}
BridgeControlSource is the read-only bridge surface required by doctor.
type BridgeProbe ¶
type BridgeProbe struct {
Source BridgeControlSource
}
BridgeProbe runs the provider-owned checks for every configured bridge.
func (*BridgeProbe) Category ¶
func (p *BridgeProbe) Category() string
func (*BridgeProbe) ID ¶
func (p *BridgeProbe) ID() string
func (*BridgeProbe) Run ¶
func (p *BridgeProbe) Run( ctx context.Context, _ *ProbeEnv, ) ([]contract.DiagnosticItem, error)
type DeadEntityProbe ¶
type DeadEntityProbe struct {
Source DeadEntitySource
Workspaces DeadEntityWorkspaceSource
Kind store.DeadEntityKind
}
DeadEntityProbe projects one runtime family without mutating its recovery state.
func (*DeadEntityProbe) Category ¶
func (p *DeadEntityProbe) Category() string
func (*DeadEntityProbe) ID ¶
func (p *DeadEntityProbe) ID() string
func (*DeadEntityProbe) Run ¶
func (p *DeadEntityProbe) Run( ctx context.Context, _ *ProbeEnv, ) ([]contract.DiagnosticItem, error)
type DeadEntitySource ¶
type DeadEntitySource interface {
List(ctx context.Context, workspaceID string) ([]store.DeadEntity, error)
}
DeadEntitySource is the read-only durable reliability surface required by doctor.
type DeadEntityWorkspaceSource ¶
type DeadEntityWorkspaceSource interface {
List(context.Context) ([]workspacepkg.Workspace, error)
}
DeadEntityWorkspaceSource lists the workspace authorities doctor must inspect.
type Probe ¶
type Probe interface {
ID() string
Category() string
Run(context.Context, *ProbeEnv) ([]contract.DiagnosticItem, error)
}
Probe executes one doctor diagnostic check. Implementations should return when the context is canceled so the runner can reclaim their goroutine; the per-probe deadline is enforced either way.
type ProbeFunc ¶
type ProbeFunc struct {
ProbeID string
ProbeCategory string
RunFunc func(context.Context, *ProbeEnv) ([]contract.DiagnosticItem, error)
}
ProbeFunc adapts a function into a Probe for extensions and tests.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores doctor probes and returns them sorted by ID.
type RunOptions ¶
type RunOptions struct {
Only []string
Exclude []string
Quiet bool
Timeout time.Duration
ProbeTimeout time.Duration
Env ProbeEnv
}
RunOptions controls doctor execution.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes registered probes in deterministic order.
func (*Runner) Run ¶
func (r *Runner) Run(ctx context.Context, opts RunOptions) ([]contract.DiagnosticItem, error)
Run executes every selected probe and sanitizes every returned DiagnosticItem.
type RuntimeMemoryProbe ¶
type RuntimeMemoryProbe struct {
Source RuntimeMemorySnapshotSource
}
RuntimeMemoryProbe projects daemon-owned process memory into doctor diagnostics.
func (*RuntimeMemoryProbe) Category ¶
func (*RuntimeMemoryProbe) Category() string
func (*RuntimeMemoryProbe) ID ¶
func (*RuntimeMemoryProbe) ID() string
func (*RuntimeMemoryProbe) Run ¶
func (p *RuntimeMemoryProbe) Run( _ context.Context, _ *ProbeEnv, ) ([]contract.DiagnosticItem, error)
type RuntimeMemorySnapshot ¶
type RuntimeMemorySnapshot struct {
Enabled bool
Active bool
CapturedAt time.Time
Phase string
ResidentMemoryBytes uint64
ResidentMemoryKind string
ResidentMemoryAvailable bool
HeapAllocBytes uint64
HeapInUseBytes uint64
Goroutines int
UptimeSeconds int64
}
RuntimeMemorySnapshot is one immutable daemon process-memory observation.
type RuntimeMemorySnapshotSource ¶
type RuntimeMemorySnapshotSource interface {
RuntimeMemorySnapshot() RuntimeMemorySnapshot
}
RuntimeMemorySnapshotSource returns the daemon's latest process-memory observation.
type SubprocessHealthProbe ¶
type SubprocessHealthProbe struct {
Source SubprocessHealthSnapshotSource
}
SubprocessHealthProbe projects failed active-process health verdicts into doctor diagnostics.
func (*SubprocessHealthProbe) Category ¶
func (*SubprocessHealthProbe) Category() string
func (*SubprocessHealthProbe) ID ¶
func (*SubprocessHealthProbe) ID() string
func (*SubprocessHealthProbe) Run ¶
func (p *SubprocessHealthProbe) Run( _ context.Context, _ *ProbeEnv, ) ([]contract.DiagnosticItem, error)
type SubprocessHealthSnapshotSource ¶
type SubprocessHealthSnapshotSource interface {
SubprocessHealthSnapshots() []session.SubprocessHealthSnapshot
}
SubprocessHealthSnapshotSource returns immutable active-process health observations.