armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Add ServerMetrics to collect metrics related server

Open seongbeenkim opened this issue 10 months ago โ€ข 2 comments

Motivation:

Add ServerMetrics to collect metrics related server. #4992

Modifications:

  • Add ServerMetrics.increasePendingHttp1Requests() in Http1RequestDecoder#channelRead before fireChannelRead()
  • Add ServerMetrics.increasePendingHttp2Requests() in Http2RequestDecoder#onHeadersRead before fireChannelRead()
  • Add ServerMetrics.decreasePendingHttp1Requests(), ServerMetrics.decreasePendingHttp2Requests(), ServerMetrics.increaseActiveHttp1WebSocketRequests(), ServerMetrics.increaseActiveHttp1Requests() and ServerMetrics.increaseActiveHttp2Requests() in HttpServerHandler#serve0 before service.serve(reqCtx, req)
  • Add ServerMetrics.decreaseActiveHttp1WebSocketRequests(), ServerMetrics.decreaseActiveHttp1Requests() and ServerMetrics.decreaseActiveHttp2Requests() in AbstractHttpResponseHandler#tryComplete
  • Add ServerMetrics.increaseActiveConnectionsAndGet() and ServerMetrics.decreaseActiveConnections() in ConnectionLimitingHandler#channelRead

Result:

  • Closes #4992. (If this resolves the issue.)
  • users can implement features based on ServerMertrics like graceful shutdowns such as stopping the server when there are no pending requests.

seongbeenkim avatar Apr 22 '24 07:04 seongbeenkim

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 22 '24 07:04 CLAassistant

๐Ÿ” Build Scanยฎ (commit: 9371f15c6ceb647890230bbc6f337710e713c68d)

Job name Status Build Scanยฎ
build-windows-latest-jdk-21 โœ… https://ge.armeria.dev/s/f6dangr2eafsq
build-self-hosted-unsafe-jdk-8 โœ… https://ge.armeria.dev/s/jgktuyts66nym
build-self-hosted-unsafe-jdk-21-snapshot-blockhound โœ… https://ge.armeria.dev/s/trchnvzvvczmq
build-self-hosted-unsafe-jdk-17-min-java-17-coverage โœ… https://ge.armeria.dev/s/nnvlgviplsawm
build-self-hosted-unsafe-jdk-17-min-java-11 โœ… https://ge.armeria.dev/s/y6fsk52tlpdm4
build-self-hosted-unsafe-jdk-17-leak โœ… https://ge.armeria.dev/s/tg552oevoqtns
build-self-hosted-unsafe-jdk-11 โœ… https://ge.armeria.dev/s/ppsia33yhdrvi
build-macos-12-jdk-21 โœ… https://ge.armeria.dev/s/3ir4tnr5aqgho

github-actions[bot] avatar Apr 22 '24 08:04 github-actions[bot]

Let me resolve the conflict. ๐Ÿ˜‰

minwoox avatar May 21 '24 13:05 minwoox

Gentle ping ๐Ÿ™

jrhee17 avatar May 29 '24 08:05 jrhee17

I've pushed commits because we are about to release the next version. There are also some failing tests that will be resolved after https://github.com/line/armeria/pull/5680 gets merged.

minwoox avatar May 30 '24 13:05 minwoox

Thanks a lot, @seongbeenkim! ๐Ÿ˜‰

minwoox avatar Jun 10 '24 07:06 minwoox