docs(agent): 统一中文注释并补充部署文档

将代码与测试注释改为中文以符合仓库规范;新增中文部署指南、
示例配置,并完善构建脚本对 VERSION 注入的说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
codex
2026-05-19 02:30:49 +00:00
parent 89d5e27874
commit 877e4cf41d
28 changed files with 608 additions and 226 deletions

View File

@@ -9,7 +9,7 @@ import (
"mfd-monitor-agent/internal/status"
)
// TestCollectorFailuresReturnPartialSnapshot verifies failed collectors do not fail snapshots.
// TestCollectorFailuresReturnPartialSnapshot 验证采集器失败不会导致整份快照失败。
func TestCollectorFailuresReturnPartialSnapshot(t *testing.T) {
cache := NewCache([]Collector{
CollectorFunc(func(context.Context, *status.HostStatus) error {
@@ -30,7 +30,7 @@ func TestCollectorFailuresReturnPartialSnapshot(t *testing.T) {
}
}
// TestCacheStoresLastSnapshot verifies successful collection is cached.
// TestCacheStoresLastSnapshot 验证成功采集结果被缓存。
func TestCacheStoresLastSnapshot(t *testing.T) {
cache := NewCache([]Collector{
CollectorFunc(func(_ context.Context, out *status.HostStatus) error {
@@ -50,7 +50,7 @@ func TestCacheStoresLastSnapshot(t *testing.T) {
}
}
// TestRunCollectsImmediately verifies Run collects before the first interval tick.
// TestRunCollectsImmediately 验证 Run 在首个间隔 tick 之前立即采集。
func TestRunCollectsImmediately(t *testing.T) {
collected := make(chan struct{})
cache := NewCache([]Collector{
@@ -79,7 +79,7 @@ func TestRunCollectsImmediately(t *testing.T) {
}
}
// TestCollectWithTimeoutMarksCanceledCollectorPartial verifies timeout errors are partial.
// TestCollectWithTimeoutMarksCanceledCollectorPartial 验证超时被记为 partial。
func TestCollectWithTimeoutMarksCanceledCollectorPartial(t *testing.T) {
cache := NewCache([]Collector{
CollectorFunc(func(ctx context.Context, _ *status.HostStatus) error {