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

topfreegames / pitaya / 27141435631
61%
master: 69%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 08 Jun 2026 01:52PM UTC
Jobs 1
Files 85
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 01:34PM UTC coverage: 61.255% (-0.4%) from 61.703%
27141435631

Pull #500

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 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 #500: feat(metrics): instrument handler/RPC channel buffers and worker pools

26 of 84 new or added lines in 5 files covered. (30.95%)

21 existing lines in 4 files now uncovered.

5173 of 8445 relevant lines covered (61.26%)

0.68 hits per line

Uncovered Changes

Lines Coverage ∆ File
22
0.0
0.0% metrics/prometheus_reporter.go
21
52.22
-15.89% metrics/report.go
10
69.39
-1.72% service/handler.go
5
73.31
2.83% cluster/nats_rpc_server.go

Coverage Regressions

Lines Coverage ∆ File
12
67.76
-3.38% app.go
6
62.64
-6.59% module.go
2
69.39
-1.72% service/handler.go
1
73.31
2.83% cluster/nats_rpc_server.go
Jobs
ID Job ID Ran Files Coverage
1 27141435631.1 08 Jun 2026 01:52PM UTC 85
61.26
GitHub Action Run
Source Files on build 27141435631
  • Tree
  • List 85
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #500
  • PR Base - v2 (#25187905565)
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