builtin

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MemoryMetrics

func MemoryMetrics(agents []ffi.AgentInfo) []*commonpb.Metric

MemoryMetrics converts a shared-memory agent snapshot into gauges.

func PortMetrics added in v0.1.0

func PortMetrics(ports []ffi.PortGroup) []*commonpb.Metric

PortMetrics converts a port counter snapshot into cumulative counters.

Types

type Counters

type Counters struct {
	ynpb.UnimplementedCountersServiceServer
	// contains filtered or unexported fields
}

Counters is an in-process gRPC service for retrieving counters.

func NewCounters

func NewCounters(instanceID uint32, shm *ffi.SharedMemory, options ...CountersOption) *Counters

NewCounters creates a new Counters service.

func (*Counters) ByTags

ByTags returns counters grouped by tag set, filtered by the request's tag predicates and name patterns.

func (*Counters) Collect

func (m *Counters) Collect() []*commonpb.Metric

Collect returns a generic metrics snapshot for worker counters.

A family that fails to collect is omitted from the snapshot, so a consumer sees a gap for that scrape rather than stale values.

func (*Counters) CollectPortMetrics added in v0.1.0

func (m *Counters) CollectPortMetrics() []*commonpb.Metric

CollectPortMetrics returns a metrics snapshot of the hardware port counters, which describe the ports themselves and read the same from every instance.

A snapshot that fails to collect comes back empty, so a consumer sees a gap for that scrape rather than stale values.

func (*Counters) Endpoint

func (m *Counters) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Counters) Name

func (m *Counters) Name() string

Name returns the service name.

func (*Counters) Ports

func (*Counters) RegisterService

func (m *Counters) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Counters) ServicesNames

func (m *Counters) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

func (*Counters) Workers

Workers returns a per-worker snapshot: cumulative polling and traffic counters plus the RX pool occupancy gauges.

type CountersOption

type CountersOption func(*countersOptions)

CountersOption configures the Counters constructor.

func WithCountersLog

func WithCountersLog(log *zap.Logger) CountersOption

WithCountersLog sets the logger for the counters service.

type Device

type Device struct {
	ynpb.UnimplementedDeviceServiceServer
	// contains filtered or unexported fields
}

Device is an in-process gRPC service for listing and deleting dataplane devices.

func NewDevice

func NewDevice(instanceID uint32, shm *ffi.SharedMemory) *Device

NewDevice creates a new Device service.

func (*Device) Delete added in v0.1.0

func (m *Device) Delete(
	ctx context.Context,
	request *ynpb.DeleteDeviceRequest,
) (*ynpb.DeleteDeviceResponse, error)

Delete removes a device by name. A predefined topology device is refused and an absent name is reported as not found.

func (*Device) Endpoint

func (m *Device) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Device) List

List returns all configured devices with their registry indices.

func (*Device) Name

func (m *Device) Name() string

Name returns the service name.

func (*Device) RegisterService

func (m *Device) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Device) ServicesNames

func (m *Device) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

type Function

type Function struct {
	ynpb.UnimplementedFunctionServiceServer
	// contains filtered or unexported fields
}

Function is an in-process gRPC service for managing functions.

func NewFunction

func NewFunction(instanceID uint32, shm *ffi.SharedMemory, options ...FunctionOption) *Function

NewFunction creates a new Function service.

func (*Function) Delete

Delete deletes the function with the given name.

func (*Function) Endpoint

func (m *Function) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Function) Get

Get returns the function with the given ID.

func (*Function) List

List returns all function IDs.

func (*Function) Name

func (m *Function) Name() string

Name returns the service name.

func (*Function) RegisterService

func (m *Function) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Function) ServicesNames

func (m *Function) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

func (*Function) Update

Update updates or inserts a function.

type FunctionOption

type FunctionOption func(*functionOptions)

FunctionOption configures the Function constructor.

func WithFunctionLog

func WithFunctionLog(log *zap.Logger) FunctionOption

WithFunctionLog sets the logger for the function service.

type Inspect

type Inspect struct {
	ynpb.UnimplementedInspectServiceServer
	// contains filtered or unexported fields
}

Inspect is an in-process gRPC service for inspecting the dataplane configuration.

func NewInspect

func NewInspect(instanceID uint32, shm *ffi.SharedMemory) *Inspect

NewInspect creates a new Inspect service.

func (*Inspect) Endpoint

func (m *Inspect) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Inspect) Inspect

func (m *Inspect) Inspect(
	ctx context.Context,
	request *ynpb.InspectRequest,
) (*ynpb.InspectResponse, error)

Inspect returns inspection data for the dataplane instance.

func (*Inspect) Name

func (m *Inspect) Name() string

Name returns the service name.

func (*Inspect) RegisterService

func (m *Inspect) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Inspect) ServicesNames

func (m *Inspect) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

type Logging

type Logging struct {
	ynpb.UnimplementedLoggingServer
	// contains filtered or unexported fields
}

Logging is an in-process gRPC service that exposes logging configuration at runtime.

func NewLogging

func NewLogging(level *zap.AtomicLevel, options ...LoggingOption) *Logging

NewLogging creates a new Logging service.

func (*Logging) Endpoint

func (m *Logging) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Logging) GetLevel added in v0.1.0

func (m *Logging) GetLevel(
	ctx context.Context,
	req *ynpb.GetLevelRequest,
) (*ynpb.GetLevelResponse, error)

GetLevel returns the minimum logging level currently in effect.

func (*Logging) Name

func (m *Logging) Name() string

Name returns the service name.

func (*Logging) RegisterService

func (m *Logging) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Logging) ServicesNames

func (m *Logging) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

func (*Logging) UpdateLevel

func (m *Logging) UpdateLevel(
	ctx context.Context,
	req *ynpb.UpdateLevelRequest,
) (*ynpb.UpdateLevelResponse, error)

UpdateLevel updates the minimum logging level.

type LoggingOption

type LoggingOption func(*loggingOptions)

LoggingOption configures the Logging constructor.

func WithLoggingLevelObserver

func WithLoggingLevelObserver(observer func(zapcore.Level)) LoggingOption

WithLoggingLevelObserver registers a function called with the new level every time UpdateLevel changes it, in addition to the atomic Go level.

This is how a runtime level change also reaches lib/logging's C gate, without this package importing the cgo-based clog package.

func WithLoggingLog

func WithLoggingLog(log *zap.Logger) LoggingOption

WithLoggingLog sets the logger for the logging service.

type Memory

type Memory struct {
	ynpb.UnimplementedMemoryServiceServer
	// contains filtered or unexported fields
}

Memory is an in-process gRPC service for reporting per-agent shared-memory arena utilization and for growing an agent's arena.

func NewMemory

func NewMemory(instanceID uint32, shm *ffi.SharedMemory) *Memory

NewMemory creates a new Memory service.

func (*Memory) Collect

func (m *Memory) Collect() []*commonpb.Metric

Collect returns arena occupancy and memory-context attribution gauges for every agent.

The free-byte count is the authoritative measure of how full an arena is: the buddy allocator behind the memory-context tree rounds each request up to a pool size, and an out-of-order module teardown can drop a live subtree from the tree walk, so the tree is attribution only.

func (*Memory) Endpoint

func (m *Memory) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Memory) ExtendAgent added in v0.1.0

func (m *Memory) ExtendAgent(
	ctx context.Context,
	request *ynpb.ExtendAgentRequest,
) (*ynpb.ExtendAgentResponse, error)

ExtendAgent grows the arena of a live agent by the requested size.

The size is a lower bound: the allocator rounds it up to its own granularity, so the reported limit may exceed what was asked for.

func (*Memory) ListArenas

func (m *Memory) ListArenas(
	ctx context.Context,
	request *ynpb.ListArenasRequest,
) (*ynpb.ListArenasResponse, error)

ListArenas returns arena utilization for every agent generation.

func (*Memory) Name

func (m *Memory) Name() string

Name returns the service name.

func (*Memory) RegisterService

func (m *Memory) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Memory) ServicesNames

func (m *Memory) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

type Pipeline

type Pipeline struct {
	ynpb.UnimplementedPipelineServiceServer
	// contains filtered or unexported fields
}

Pipeline is an in-process gRPC service for managing pipelines.

func NewPipeline

func NewPipeline(instanceID uint32, shm *ffi.SharedMemory, options ...PipelineOption) *Pipeline

NewPipeline creates a new Pipeline service.

func (*Pipeline) Delete

Delete deletes the pipeline with the given ID.

func (*Pipeline) Endpoint

func (m *Pipeline) Endpoint() string

Endpoint returns empty string indicating in-process service.

func (*Pipeline) Get

Get returns the pipeline with the given ID.

func (*Pipeline) List

List returns all pipeline IDs.

func (*Pipeline) Name

func (m *Pipeline) Name() string

Name returns the service name.

func (*Pipeline) RegisterService

func (m *Pipeline) RegisterService(server *grpc.Server)

RegisterService registers the service on the given gRPC server.

func (*Pipeline) ServicesNames

func (m *Pipeline) ServicesNames() []string

ServicesNames returns the gRPC service names served by this service.

func (*Pipeline) Update

Update updates or inserts a pipeline.

type PipelineOption

type PipelineOption func(*pipelineOptions)

PipelineOption configures the Pipeline constructor.

func WithPipelineLog

func WithPipelineLog(log *zap.Logger) PipelineOption

WithPipelineLog sets the logger for the pipeline service.

Jump to

Keyboard shortcuts

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