fix(server): 修复 Agent 上报访问日志的 bytes_sent 在 Server 入库链路丢失,导致 Zone 概览“已提供的数据总计”长期为 0 的问题。

This commit is contained in:
ryan
2026-07-12 19:02:52 +08:00
parent c624512da6
commit 69467914fc
5 changed files with 48 additions and 9 deletions
@@ -39,6 +39,7 @@ func TestBatchInsertNodeAccessLogs_UsesModelBatchSQL(t *testing.T) {
Host: "example.com",
Path: "/alpha",
StatusCode: 200,
BytesSent: 2048,
CreatedAt: loggedAt,
},
})
@@ -48,4 +49,6 @@ func TestBatchInsertNodeAccessLogs_UsesModelBatchSQL(t *testing.T) {
assert.True(t, mockBatch.sendCalled)
require.Len(t, mockBatch.rows, 1)
assert.Equal(t, "node-a", mockBatch.rows[0][1])
}
require.Len(t, mockBatch.rows[0], 10)
assert.Equal(t, uint64(2048), mockBatch.rows[0][8])
}