Documentation
¶
Index ¶
- func MemoryMetrics(agents []ffi.AgentInfo) []*commonpb.Metric
- func PortMetrics(ports []ffi.PortGroup) []*commonpb.Metric
- type Counters
- func (m *Counters) ByTags(ctx context.Context, request *ynpb.CountersByTagsRequest) (*ynpb.CountersByTagsResponse, error)
- func (m *Counters) Collect() []*commonpb.Metric
- func (m *Counters) CollectPortMetrics() []*commonpb.Metric
- func (m *Counters) Endpoint() string
- func (m *Counters) Name() string
- func (m *Counters) Ports(ctx context.Context, request *ynpb.PortCountersRequest) (*ynpb.PortCountersResponse, error)
- func (m *Counters) RegisterService(server *grpc.Server)
- func (m *Counters) ServicesNames() []string
- func (m *Counters) Workers(ctx context.Context, request *ynpb.WorkerCountersRequest) (*ynpb.WorkerCountersResponse, error)
- type CountersOption
- type Device
- func (m *Device) Delete(ctx context.Context, request *ynpb.DeleteDeviceRequest) (*ynpb.DeleteDeviceResponse, error)
- func (m *Device) Endpoint() string
- func (m *Device) List(ctx context.Context, request *ynpb.ListDevicesRequest) (*ynpb.ListDevicesResponse, error)
- func (m *Device) Name() string
- func (m *Device) RegisterService(server *grpc.Server)
- func (m *Device) ServicesNames() []string
- type Function
- func (m *Function) Delete(ctx context.Context, request *ynpb.DeleteFunctionRequest) (*ynpb.DeleteFunctionResponse, error)
- func (m *Function) Endpoint() string
- func (m *Function) Get(ctx context.Context, request *ynpb.GetFunctionRequest) (*ynpb.GetFunctionResponse, error)
- func (m *Function) List(ctx context.Context, request *ynpb.ListFunctionsRequest) (*ynpb.ListFunctionsResponse, error)
- func (m *Function) Name() string
- func (m *Function) RegisterService(server *grpc.Server)
- func (m *Function) ServicesNames() []string
- func (m *Function) Update(ctx context.Context, request *ynpb.UpdateFunctionRequest) (*ynpb.UpdateFunctionResponse, error)
- type FunctionOption
- type Inspect
- type Logging
- func (m *Logging) Endpoint() string
- func (m *Logging) GetLevel(ctx context.Context, req *ynpb.GetLevelRequest) (*ynpb.GetLevelResponse, error)
- func (m *Logging) Name() string
- func (m *Logging) RegisterService(server *grpc.Server)
- func (m *Logging) ServicesNames() []string
- func (m *Logging) UpdateLevel(ctx context.Context, req *ynpb.UpdateLevelRequest) (*ynpb.UpdateLevelResponse, error)
- type LoggingOption
- type Memory
- func (m *Memory) Collect() []*commonpb.Metric
- func (m *Memory) Endpoint() string
- func (m *Memory) ExtendAgent(ctx context.Context, request *ynpb.ExtendAgentRequest) (*ynpb.ExtendAgentResponse, error)
- func (m *Memory) ListArenas(ctx context.Context, request *ynpb.ListArenasRequest) (*ynpb.ListArenasResponse, error)
- func (m *Memory) Name() string
- func (m *Memory) RegisterService(server *grpc.Server)
- func (m *Memory) ServicesNames() []string
- type Pipeline
- func (m *Pipeline) Delete(ctx context.Context, request *ynpb.DeletePipelineRequest) (*ynpb.DeletePipelineResponse, error)
- func (m *Pipeline) Endpoint() string
- func (m *Pipeline) Get(ctx context.Context, request *ynpb.GetPipelineRequest) (*ynpb.GetPipelineResponse, error)
- func (m *Pipeline) List(ctx context.Context, request *ynpb.ListPipelinesRequest) (*ynpb.ListPipelinesResponse, error)
- func (m *Pipeline) Name() string
- func (m *Pipeline) RegisterService(server *grpc.Server)
- func (m *Pipeline) ServicesNames() []string
- func (m *Pipeline) Update(ctx context.Context, request *ynpb.UpdatePipelineRequest) (*ynpb.UpdatePipelineResponse, error)
- type PipelineOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MemoryMetrics ¶
MemoryMetrics converts a shared-memory agent snapshot into gauges.
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 ¶
func (m *Counters) ByTags( ctx context.Context, request *ynpb.CountersByTagsRequest, ) (*ynpb.CountersByTagsResponse, error)
ByTags returns counters grouped by tag set, filtered by the request's tag predicates and name patterns.
func (*Counters) Collect ¶
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
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) Ports ¶
func (m *Counters) Ports( ctx context.Context, request *ynpb.PortCountersRequest, ) (*ynpb.PortCountersResponse, error)
func (*Counters) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Counters) ServicesNames ¶
ServicesNames returns the gRPC service names served by this service.
func (*Counters) Workers ¶
func (m *Counters) Workers( ctx context.Context, request *ynpb.WorkerCountersRequest, ) (*ynpb.WorkerCountersResponse, error)
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) List ¶
func (m *Device) List( ctx context.Context, request *ynpb.ListDevicesRequest, ) (*ynpb.ListDevicesResponse, error)
List returns all configured devices with their registry indices.
func (*Device) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Device) ServicesNames ¶
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 ¶
func (m *Function) Delete( ctx context.Context, request *ynpb.DeleteFunctionRequest, ) (*ynpb.DeleteFunctionResponse, error)
Delete deletes the function with the given name.
func (*Function) Get ¶
func (m *Function) Get( ctx context.Context, request *ynpb.GetFunctionRequest, ) (*ynpb.GetFunctionResponse, error)
Get returns the function with the given ID.
func (*Function) List ¶
func (m *Function) List( ctx context.Context, request *ynpb.ListFunctionsRequest, ) (*ynpb.ListFunctionsResponse, error)
List returns all function IDs.
func (*Function) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Function) ServicesNames ¶
ServicesNames returns the gRPC service names served by this service.
func (*Function) Update ¶
func (m *Function) Update( ctx context.Context, request *ynpb.UpdateFunctionRequest, ) (*ynpb.UpdateFunctionResponse, error)
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) Inspect ¶
func (m *Inspect) Inspect( ctx context.Context, request *ynpb.InspectRequest, ) (*ynpb.InspectResponse, error)
Inspect returns inspection data for the dataplane instance.
func (*Inspect) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Inspect) ServicesNames ¶
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) 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) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Logging) ServicesNames ¶
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 ¶
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) 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) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Memory) ServicesNames ¶
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 ¶
func (m *Pipeline) Delete( ctx context.Context, request *ynpb.DeletePipelineRequest, ) (*ynpb.DeletePipelineResponse, error)
Delete deletes the pipeline with the given ID.
func (*Pipeline) Get ¶
func (m *Pipeline) Get( ctx context.Context, request *ynpb.GetPipelineRequest, ) (*ynpb.GetPipelineResponse, error)
Get returns the pipeline with the given ID.
func (*Pipeline) List ¶
func (m *Pipeline) List( ctx context.Context, request *ynpb.ListPipelinesRequest, ) (*ynpb.ListPipelinesResponse, error)
List returns all pipeline IDs.
func (*Pipeline) RegisterService ¶
RegisterService registers the service on the given gRPC server.
func (*Pipeline) ServicesNames ¶
ServicesNames returns the gRPC service names served by this service.
func (*Pipeline) Update ¶
func (m *Pipeline) Update( ctx context.Context, request *ynpb.UpdatePipelineRequest, ) (*ynpb.UpdatePipelineResponse, error)
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.