armeria icon indicating copy to clipboard operation
armeria copied to clipboard

add slow request sampler

Open Dogacel opened this issue 2 years ago • 5 comments

Motivation:

Add

Modifications:

  • Implement and and or operations 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.

Dogacel avatar Jun 21 '23 12:06 Dogacel

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.

Files Patch % Lines
...meria/common/util/TimeWindowPercentileSampler.java 79.48% 6 Missing and 2 partials :warning:
.../armeria/server/logging/LoggingServiceBuilder.java 80.00% 1 Missing and 2 partials :warning:
...ion/decorator/LoggingDecoratorFactoryFunction.java 88.23% 0 Missing and 2 partials :warning:
...a/com/linecorp/armeria/common/util/AndSampler.java 87.50% 1 Missing :warning:
...va/com/linecorp/armeria/common/util/OrSampler.java 87.50% 1 Missing :warning:
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.

codecov[bot] avatar Oct 07 '23 14:10 codecov[bot]

🔍 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

github-actions[bot] avatar Oct 07 '23 15:10 github-actions[bot]

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 ?

Dogacel avatar Oct 20 '23 13:10 Dogacel

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 avatar Jan 20 '24 23:01 Dogacel

@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.

trustin avatar Apr 09 '24 08:04 trustin