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

topfreegames / pitaya / 27143603019
59%
master: 69%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 08 Jun 2026 02:13PM UTC
Jobs 1
Files 91
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

08 Jun 2026 02:08PM UTC coverage: 58.544% (-0.2%) from 58.772%
27143603019

Pull #501

github

rsafonseca
feat(metrics): instrument handler/RPC channel buffers and worker pools

Several buffered channels and goroutine pools that sit on the hot path
had no instrumentation, so there was no way to tell from metrics when a
server was hitting its buffer (BUFFER_*) or concurrency (CONCURRENCY_*)
limits — the channels would just fill and apply backpressure silently.

Add capacity/utilization metrics for the previously-unmonitored ones:

Channel capacity (reuses the channel_capacity histogram, new `channel` tags):
  - handler_chlocalprocess   (buffer.handler.localprocess)
  - handler_chremoteprocess  (buffer.handler.remoteprocess)
  - rpc_server_userkickchan  (shares the nats messages buffer)

Worker-pool utilization (new gauges pitaya_worker_pool_busy_workers and
pitaya_worker_pool_total_workers, tagged by `pool`):
  - handler_dispatch    (concurrency.handler.dispatch)
  - rpc_server_remote   (cluster.rpc.server.nats.services)

Implementation:
  - Handler dispatch channels and pool are sampled periodically from
    App.periodicMetrics (no extra work on the per-message path).
  - userKickCh and the remote pool are reported from the existing nats
    reportMetrics, alongside the channels already covered there.
  - Add metrics.ReportChannelCapacity / ReportWorkerPoolUsage helpers and
    refactor nats reportMetrics to use them; each call builds its own
    label map so prometheus's label mutation can't leak across reporters.

Busy-worker counts are tracked with atomic int32 counters (two adds per
message, dwarfed by the actual handler/RPC work). Purely additive — no
existing metric, behaviour, or config is changed; works on both the
prometheus and statsd reporters.
Pull Request #501: feat(metrics): instrument handler/RPC channel buffers and worker pools

26 of 81 new or added lines in 5 files covered. (32.1%)

5 existing lines in 3 files now uncovered.

5105 of 8720 relevant lines covered (58.54%)

0.65 hits per line

Uncovered Changes

Lines Coverage ∆ File
22
0.0
0.0% pkg/metrics/prometheus_reporter.go
18
54.02
-14.09% pkg/metrics/report.go
10
68.6
-1.68% pkg/service/handler.go
5
71.76
1.66% pkg/cluster/nats_rpc_server.go

Coverage Regressions

Lines Coverage ∆ File
2
73.91
-4.35% pkg/modules/binary.go
2
68.6
-1.68% pkg/service/handler.go
1
71.76
1.66% pkg/cluster/nats_rpc_server.go
Jobs
ID Job ID Ran Files Coverage
1 27143603019.1 08 Jun 2026 02:13PM UTC 91
58.54
GitHub Action Run
Source Files on build 27143603019
  • Tree
  • List 91
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #501
  • PR Base - main (#25187910487)
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