impl

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeServiceImpl

type NodeServiceImpl struct {
	ioc.ObjectImpl

	// 清理任务的 Cron 表达式,默认每天凌晨执行
	CleanCron string `json:"clean_cron" yaml:"clean_cron" toml:"clean_cron"`
	// 清理指定小时之前的数据,默认24小时
	CleanBeforeHours int64 `json:"clean_before_hours" yaml:"clean_before_hours" toml:"clean_before_hours"`

	// 性能优化:异步批量指标更新(基于消息总线)
	// 指标事件发布Topic
	MetricTopic string `json:"metric_topic" toml:"metric_topic" yaml:"metric_topic"`
	// 指标批量处理间隔(默认3秒)
	MetricBatchIntervalSeconds int64 `json:"metric_batch_interval_seconds" toml:"metric_batch_interval_seconds" yaml:"metric_batch_interval_seconds"`
	// 指标批量大小(达到该数量即触发处理)
	MetricBatchSize int `json:"metric_batch_size" toml:"metric_batch_size" yaml:"metric_batch_size"`
	// contains filtered or unexported fields
}

func (*NodeServiceImpl) CleanMetric

CleanMetric 清理旧的 Agent 指标数据

func (*NodeServiceImpl) Close

func (i *NodeServiceImpl) Close(ctx context.Context)

func (*NodeServiceImpl) DescribeLatestMetric

func (i *NodeServiceImpl) DescribeLatestMetric(ctx context.Context, agentId string) (*node.NodeMetric, error)

DescribeLatestMetric 查询 Agent 最新指标

func (*NodeServiceImpl) DescribeNode

func (i *NodeServiceImpl) DescribeNode(ctx context.Context, nodeName string) (*node.Node, error)

DescribeNode 查询单个节点信息

func (*NodeServiceImpl) GetMetricBufferSize

func (i *NodeServiceImpl) GetMetricBufferSize() int

GetMetricBufferSize 获取当前指标缓冲区大小(用于监控)

func (*NodeServiceImpl) Init

func (i *NodeServiceImpl) Init() error

func (*NodeServiceImpl) Name

func (i *NodeServiceImpl) Name() string

func (*NodeServiceImpl) QueryAgentMetric

QueryAgentMetric 查询 Agent 指标列表

func (*NodeServiceImpl) QueryNodes

func (i *NodeServiceImpl) QueryNodes(ctx context.Context, in *node.QueryNodeRequest) (*types.Set[*node.Node], error)

QueryNodes 查询节点列表

func (*NodeServiceImpl) RegisterNode

func (i *NodeServiceImpl) RegisterNode(ctx context.Context, in *node.RegisterNodeRequest) (*node.Node, error)

RegisterNode 注册节点(支持幂等操作)

func (*NodeServiceImpl) SaveAgentMetric

func (i *NodeServiceImpl) SaveAgentMetric(ctx context.Context, in *node.NodeMetric) error

SaveAgentMetric 保存 Agent 指标(异步批量处理)

func (*NodeServiceImpl) UnregisterNode

func (i *NodeServiceImpl) UnregisterNode(ctx context.Context, nodeName string) error

UnregisterNode 注销节点,同时删除该节点的所有 metrics

func (*NodeServiceImpl) UpdateNodeHeartbeat

func (i *NodeServiceImpl) UpdateNodeHeartbeat(ctx context.Context, nodeName string) error

UpdateNodeHeartbeat 更新节点心跳时间

Jump to

Keyboard shortcuts

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