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

grpc / grpc-java / #20271
89%

Build:
DEFAULT BRANCH: master
Ran 07 May 2026 09:38AM UTC
Jobs 1
Files 653
Run time 2min
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

07 May 2026 09:27AM UTC coverage: 88.828% (+0.01%) from 88.816%
#20271

push

github

web-flow
xds: pre-parse custom metric names in WRR load balancer (#12773)

Introduce ParsedMetricName in MetricReportUtils to pre-parse configured
custom metric names into Enums and key Strings on config initialization
in WeightedRoundRobinLoadBalancerConfig, avoiding String parsing
operations in the data path.

This has been done by a combination of a few things

- Streams -> loop
- OptionalDouble -> double : We decided to take a hit here because it
provides semantic correctness over using sentinels.
- Pre parsing instead of hot path substring

OrcaReportListener now utilizes pre-parsed ParsedMetricName objects
during getCustomMetricUtilization to prevent OptionalDouble heap
allocations on the hot path.

Updated test coverage in MetricReportUtilsTest and
WeightedRoundRobinLoadBalancerTest.

# JMH Benchmark Report: MetricReportUtils Optimization

We performed a benchmark comparison of four different custom metric
resolution implementations in the Weighted Round Robin (WRR) load
balancer.

## Benchmark Results

| Benchmark Variant | Average Latency | Normalized Heap Allocations |
Speedup |
| :------------------------------------ | :-------------- |
:-------------------------- | :-------- |
| **Baseline (`String` + Streams)** | 174.46 ns/op | 704.00 B/op | 1x |
| **`ParsedMetricName` + Streams** | 148.95 ns/op | 608.00 B/op | ~1.1x
|
| **`String` + Loop** | 81.61 ns/op | 240.00 B/op | ~2.1x |
| **`ParsedMetricName` + Loop** | 52.92 ns/op | 144.00 B/op | ~3.2x |
| **`ParsedMetricName` + Unboxed Loop** | **43.76 ns/op** | **≈ 0.00
B/op** | **~4.0x** |

---

36247 of 40806 relevant lines covered (88.83%)

0.89 hits per line

Coverage Regressions

Lines Coverage ∆ File
5
98.6
0.04% ../xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancer.java
4
91.59
-1.87% ../xds/src/main/java/io/grpc/xds/client/ControlPlaneClient.java
2
90.56
-0.7% ../core/src/main/java/io/grpc/internal/DelayedClientCall.java
1
93.21
-0.14% ../okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java
1
97.35
-0.88% ../okhttp/src/main/java/io/grpc/okhttp/OkHttpServerStream.java
1
93.83
-0.62% ../opentelemetry/src/main/java/io/grpc/opentelemetry/OpenTelemetryMetricSink.java
1
74.14
-0.86% ../servlet/src/main/java/io/grpc/servlet/ServletServerStream.java
Jobs
ID Job ID Ran Files Coverage
1 #20271.1 07 May 2026 09:38AM UTC 653
88.83
Source Files on build #20271
  • Tree
  • List 653
  • Changed 12
  • Source Changed 0
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20271
  • 324fce71 on github
  • Prev Build on master
  • Next Build on master
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