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

Hyshmily / Zeta / 29380198503

15 Jul 2026 12:52AM UTC coverage: 86.052% (-0.3%) from 86.358%
29380198503

push

github

Hyshmily
feat: add cache-key.strip-query config and refine WorkerConfigNegotiator code

The local cache used raw URLs as keys, so two calls with the same business resource but different query parameters (e.g., `?region=us` vs `?region=eu`) would be stored as separate Caffeine entries. This fragmentation diluted the HeavyKeeper hot-key detection because the same underlying data was spread across many entries, each seeing a low access frequency. The problem grew worse as the number of distinct query-parameter combinations increased, often causing the cache to hold numerous near-duplicates while the hot-key mechanism failed to promote any of them.

To solve this, a new boolean configuration `zeta.local.cache-key.strip-query` was introduced (default `false`). When enabled, the cache key is stripped of its query string (`?key=val`) before any cache lookup or insertion, so all variants of the same resource coalesce into a single Caffeine entry. The stripping logic is omitted when the flag is disabled, incurring zero overhead for users who do not need it. The implementation adds a simple `lastIndexOf('?')` check and substring, which is O(length of key) in the worst case but typically negligible compared to the hashing and cache operation themselves. By consolidating entries, the HeavyKeeper frequency sketches now see the true access rate of the business data, improving hot-key promotion accuracy.

Alongside the feature, the code in `WorkerConfigNegotiator.java` had its import statements reordered to follow the project convention (third-party imports before standard Java imports) and an empty Javadoc comment left over from an earlier refactoring was removed. These changes carry no behavioural difference but improve readability and maintain consistency with the rest of the codebase.

Signed-off-by: Hyshmily <cxm8607@outlook.com>

1490 of 1854 branches covered (80.37%)

Branch coverage included in aggregate %.

4124 of 4670 relevant lines covered (88.31%)

4.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.67
/common/src/main/java/io/github/hyshmily/zeta/cache/HotKeyCache.java


Source Not Available

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