• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cybertec-postgresql / pgwatch / 25668650925
86%

Build:
DEFAULT BRANCH: master
Ran 11 May 2026 12:00PM UTC
Jobs 1
Files 46
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 May 2026 11:56AM UTC coverage: 85.628% (+1.1%) from 84.533%
25668650925

push

github

pashagolub
[!] reaper goroutine consolidation via `pgx.Batch` queries (#1316)

The improvements stem from consolidating N per-metric goroutines into a single per-source SourceReaper that uses a GCD-based (Greatest Common Divisor) tick loop and pgx.Batch for batched SQL execution, dramatically reducing goroutine overhead, connection contention, scheduling pressure, and memory allocation churn.

For 6 sources test run batch implementation eliminates 414 per-metric goroutines, replacing them with just 6 per-source goroutines. All infrastructure goroutines (pool health checks, sinks, logging, web server) remain identical between both implementations.

The 4× reduction in stack memory directly reflects the goroutine count difference — each goroutine requires its own stack.

At steady state (after initial warmup), the batch implementation allocates approximately 8–9× less memory per minute.

While GC cycle counts are similar, the CPU fraction spent on GC is ~3× lower for batch because each cycle processes far fewer live objects (45K vs 510K).

---------

Co-authored-by: 0xgouda <gouda0x@gmail.com>
Co-authored-by: Mazen Kamal <71020170+Mazen050@users.noreply.github.com>

222 of 287 new or added lines in 6 files covered. (77.35%)

6 existing lines in 2 files now uncovered.

4653 of 5434 relevant lines covered (85.63%)

0.98 hits per line

Uncovered Changes

Lines Coverage ∆ File
45
81.4
internal/reaper/source_reaper.go
20
52.79
5.44% internal/reaper/reaper.go

Coverage Regressions

Lines Coverage ∆ File
5
52.79
5.44% internal/reaper/reaper.go
1
92.86
-0.04% internal/reaper/database.go
Jobs
ID Job ID Ran Files Coverage
1 25668650925.1 11 May 2026 12:00PM UTC 46
85.63
GitHub Action Run
Source Files on build 25668650925
  • Tree
  • List 46
  • Changed 6
  • Source Changed 6
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25668650925
  • 925f30e2 on github
  • Prev Build on master (#25374046019)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc