mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 16:16:37 +08:00
fix(agent): 观测缓冲去重纳入 cache_status 并保留原始 -
避免同一请求不同缓存状态被合并丢弃;OpenResty 的 - 原样入库便于详情区分。
This commit is contained in:
@@ -56,6 +56,18 @@ func TestCollectAccessLogsReturnsFactsOnly(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeCacheStatusKeepsDash(t *testing.T) {
|
||||
if got := normalizeCacheStatus(" - "); got != "-" {
|
||||
t.Fatalf("normalizeCacheStatus dash = %q, want -", got)
|
||||
}
|
||||
if got := normalizeCacheStatus(" HIT "); got != "HIT" {
|
||||
t.Fatalf("normalizeCacheStatus hit = %q, want HIT", got)
|
||||
}
|
||||
if got := normalizeCacheStatus(""); got != "" {
|
||||
t.Fatalf("normalizeCacheStatus empty = %q, want empty", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCollectAccessLogsResetsOffsetAfterTruncate(t *testing.T) {
|
||||
tempDir := t.TempDir()
|
||||
logPath := filepath.Join(tempDir, "openflare_access.log")
|
||||
|
||||
Reference in New Issue
Block a user