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

cybertec-postgresql / pgwatch / 25661930733
86%

Build:
DEFAULT BRANCH: master
Ran 11 May 2026 09:32AM 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 09:28AM UTC coverage: 86.066% (+1.5%) from 84.533%
25661930733

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>

529 of 621 new or added lines in 6 files covered. (85.19%)

11 existing lines in 2 files now uncovered.

4966 of 5770 relevant lines covered (86.07%)

0.98 hits per line

Uncovered Changes

Lines Coverage ∆ File
45
81.4
internal/reaper/source_reaper.go
27
92.45
-0.45% internal/reaper/database.go
20
54.51
7.15% internal/reaper/reaper.go

Coverage Regressions

Lines Coverage ∆ File
10
92.45
-0.45% internal/reaper/database.go
1
54.51
7.15% internal/reaper/reaper.go
Jobs
ID Job ID Ran Files Coverage
1 25661930733.1 11 May 2026 09:32AM UTC 46
86.07
GitHub Action Run
Source Files on build 25661930733
  • 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 #25661930733
  • ac342ed5 on github
  • Prev Build on master (#25374046019)
  • Next Build on master (#25668650925)
  • 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