MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestEnsureQueryLogTableWithAttachedCatalog

Function TestEnsureQueryLogTableWithAttachedCatalog

server/querylog_test.go:422–447  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

420 CPUTimeSeconds: 2.75,
421 PeakBufferMemoryBytes: 8192,
422 PostgresScanSeconds: 0.456,
423 }
424
425 c.logQuery(time.Unix(1700000000, 0).UTC(), "SELECT 1", "", "SELECT", 1, 0, "", "", "simple")
426
427 select {
428 case entry := <-ql.ch:
429 if entry.CPUTimeSeconds != 2.75 {
430 t.Fatalf("expected CPUTimeSeconds 2.75, got %f", entry.CPUTimeSeconds)
431 }
432 if entry.PeakBufferMemoryBytes != 8192 {
433 t.Fatalf("expected PeakBufferMemoryBytes 8192, got %d", entry.PeakBufferMemoryBytes)
434 }
435 if entry.PostgresScanMs != 456 {
436 t.Fatalf("expected PostgresScanMs 456, got %d", entry.PostgresScanMs)
437 }
438 default:
439 t.Fatal("expected query log entry")
440 }
441
442 if c.lastProfilingSummary != (observe.QueryProfilingSummary{}) {
443 t.Fatalf("expected profiling summary to be reset, got %#v", c.lastProfilingSummary)
444 }
445}
446
447type captureQueryLogExecutor struct {
448 feedbackExecutor
449 entries []QueryLogEntry
450}

Callers

nothing calls this directly

Calls 5

ensureQueryLogTableFunction · 0.85
queryLogColumnTypeFunction · 0.85
CloseMethod · 0.65
ExecMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected