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

@@ -7,7 +7,7 @@ import (
"testing"
)
// TestWindowsMemoryInfoFromStatus verifies Windows memory counters are exposed in bytes.
// TestWindowsMemoryInfoFromStatus 验证 Windows 内存计数以字节对外暴露。
func TestWindowsMemoryInfoFromStatus(t *testing.T) {
got := windowsMemoryInfoFromStatus(windowsMemoryStatus{
TotalPhys: 10,
@@ -25,14 +25,14 @@ func TestWindowsMemoryInfoFromStatus(t *testing.T) {
}
}
// TestWindowsTCPPortFromNetworkOrder verifies Windows TCP port values are decoded.
// TestWindowsTCPPortFromNetworkOrder 验证 Windows TCP 端口值被正确解码。
func TestWindowsTCPPortFromNetworkOrder(t *testing.T) {
if got := windowsTCPPortFromNetworkOrder(0x0000901f); got != 8080 {
t.Fatalf("port = %d, want 8080", got)
}
}
// TestWindowsDiskInfoFromSpace verifies Windows disk counters are mapped to API disk fields.
// TestWindowsDiskInfoFromSpace 验证 Windows 磁盘计数映射到 API 磁盘字段。
func TestWindowsDiskInfoFromSpace(t *testing.T) {
got := windowsDiskInfoFromSpace(`C:\`, windowsDriveFixed, 100, 40)
@@ -50,7 +50,7 @@ func TestWindowsDiskInfoFromSpace(t *testing.T) {
}
}
// TestWindowsCPUUsagePercent verifies idle and kernel counters are converted to busy percentage.
// TestWindowsCPUUsagePercent 验证空闲与内核计数转换为繁忙百分比。
func TestWindowsCPUUsagePercent(t *testing.T) {
prev := windowsSystemTimes{Idle: 100, Kernel: 500, User: 500}
next := windowsSystemTimes{Idle: 150, Kernel: 650, User: 700}
@@ -62,7 +62,7 @@ func TestWindowsCPUUsagePercent(t *testing.T) {
}
}
// TestWindowsProcessInfoFromEntry verifies Toolhelp process data is enriched with memory and command line data.
// TestWindowsProcessInfoFromEntry 验证 Toolhelp 进程数据补充内存与命令行信息。
func TestWindowsProcessInfoFromEntry(t *testing.T) {
entry := syscall.ProcessEntry32{ProcessID: 123, ParentProcessID: 12}
copy(entry.ExeFile[:], syscall.StringToUTF16("agent.exe"))