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

rm-hull / dot-block / 27438041528
61%

Build:
DEFAULT BRANCH: main
Ran 12 Jun 2026 07:26PM UTC
Jobs 1
Files 32
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

12 Jun 2026 07:26PM UTC coverage: 61.685% (+0.2%) from 61.464%
27438041528

push

github

web-flow
feat: implement latency-aware upstream routing (#155)

* feat: implement latency-aware upstream routing

Replaced the simple RoundRobin strategy with a latency-based selection
algorithm. Upstreams are now weighted by their moving-average response
times, with automatic penalties applied to failing servers to ensure
better load distribution and failover performance.

- Added EMA-based latency tracking per upstream.
- Moved latency measurement logic into the client layer.
- Updated documentation to reflect performance enhancements.

* chore: harden TLS configuration for server

- Explicitly set `MaxVersion` to TLS 1.3.
- Enforce secure cipher suites for ECDHE and AEAD.
- Enable `PreferServerCipherSuites` to prioritize server-side security.

* refactor: make latency atomic and use CAS for updates

- Changed `latency` to a pointer to `atomic.Int64` to prevent copying
  issues.
- Replaced direct `Store` operations with `CompareAndSwap` loops in
  `recordSuccess` and `recordFailure` to ensure thread-safe updates to
  the EMA and penalty logic.
- Updated `math/rand` to `math/rand/v2`.

* feat: add exponential moving average metric for upstream latency

Expose the upstream server latency EMA as a Prometheus Gauge. This
allows
monitoring of the health and responsiveness of individual upstreams in
real-time.

- Added `UpstreamEMA` metric to `DnsMetrics`.
- Updated `RoundRobinClient` to report calculated EMA on both success
  and failure.
- Simplified failure latency calculation using `min()`.

* style: align struct fields in RequestSnapshot

Improve readability by correcting alignment in the `RequestSnapshot`
struct definition.

* cleanup: remove deprecated PreferServerCipherSuites from tls.Config

Co-authored-by: rm-hull <rm-hull@users.noreply.github.com>

* refactor: adjust failure penalty and metric unit conversion

- Reduced the failure latency penalty from 500ms to 100ms per event.
- Standardized EMA metric calculation using `time.Duration.Seconds()`
  for ... (continued)

49 of 67 new or added lines in 2 files covered. (73.13%)

1428 of 2315 relevant lines covered (61.68%)

804.48 hits per line

Uncovered Changes

Lines Coverage ∆ File
18
59.73
6.67% internal/forwarder/round_robin_client.go
Jobs
ID Job ID Ran Files Coverage
1 27438041528.1 12 Jun 2026 07:26PM UTC 32
61.68
GitHub Action Run
Source Files on build 27438041528
  • Tree
  • List 32
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9ae753e5 on github
  • Prev Build on main (#27431630690)
  • Next Build on main (#27505383427)
  • 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