add slow request sampler
Motivation:
Add
Modifications:
- Implement
andandoroperations for samplers. - Implement a percentile sampler that samples if data is on x-percentile.
- Update the logging decorator to support sampling based on percentile slowness
- Give a lower bound so that even if the request is on x-percentile, don't sample it because it is still too fast.
- Give an upper bound so that even if the request is not on x-percentile, always log it because this latency is not acceptable.
Result:
- TODO
Some TODOs:
- [x] Consider having a separate sampler for each endpoint.
- [ ] Performance and memory tests.
- [x] Take snapshots every once in a while.
Codecov Report
Attention: Patch coverage is 85.71429% with 15 lines in your changes are missing coverage. Please review.
Project coverage is 74.04%. Comparing base (
b8eb810) to head (16fd779). Report is 172 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #4978 +/- ##
============================================
+ Coverage 73.95% 74.04% +0.08%
- Complexity 20115 21142 +1027
============================================
Files 1730 1839 +109
Lines 74161 78166 +4005
Branches 9465 9983 +518
============================================
+ Hits 54847 57878 +3031
- Misses 14837 15589 +752
- Partials 4477 4699 +222
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🔍 Build Scan® (commit: 16fd7799faccb28969e3b2b37c21ba1b034446a0)
| Job name | Status | Build Scan® |
|---|---|---|
| build-windows-latest-jdk-19 | ✅ | https://ge.armeria.dev/s/am2vq4osk6w2e |
| build-self-hosted-unsafe-jdk-8 | ✅ | https://ge.armeria.dev/s/f2sdb4zsacjzs |
| build-self-hosted-unsafe-jdk-19-snapshot-blockhound | ✅ | https://ge.armeria.dev/s/5qluyncrasbz2 |
| build-self-hosted-unsafe-jdk-17-min-java-17-coverage | ✅ | https://ge.armeria.dev/s/ukmoytd7rva5o |
| build-self-hosted-unsafe-jdk-17-min-java-11 | ✅ | https://ge.armeria.dev/s/pv7wwrjnhb6ya |
| build-self-hosted-unsafe-jdk-17-leak | ❌ (failure) | https://ge.armeria.dev/s/pycyjosfvbf5q |
| build-self-hosted-unsafe-jdk-11 | ✅ | https://ge.armeria.dev/s/645dfs4ckagy6 |
| build-macos-12-jdk-19 | ❌ (failure) | https://ge.armeria.dev/s/wevqaeq3tvtiy |
I have realized my test coverage was missing in some methods, with the latest commit it should be resolved.
Still there are uncovered lines such as toString(), is it fine to skip them?
@ikhoon @minwoox ?
Hi team, would like to continue on this. It's been a rough couple weeks, LMK if you still see value in this feature, thanks ❤️
@Dogacel Sorry that we were not as responsive as we wished. Yes, we're definitely interested in this PR. I left a couple small comments.