Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove metric locks, frame type and channel namespace resolution for transport messages sent/received #325

Merged
merged 14 commits into from
Oct 23, 2023

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Oct 19, 2023

Some improvements for Centrifuge metrics:

  • Get rid of registry locks from all metric increments, this should remove contention and result into better latency overall
  • Add transport_messages_sent_size, transport_messages_received, transport_messages_received_size
  • Add frame type resolution to transport_messages_sent, transport_messages_sent_size, transport_messages_received, transport_messages_received_size
  • Add possibility to annotate transport messages metrics (both sent and received) with channel namespace label. This is optional as may bring some overhead
  • benchmark for incTransportMessagesSent, incTransportMessagesReceived (1 alloc may gone away in real code):
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkTransportMessagesSent-12        	41522294	29.78 ns/op	  8 B/op	  1 allocs/op
BenchmarkTransportMessagesReceived-12    	39113955	30.66 ns/op	  8 B/op	  1 allocs/op

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #325 (4616083) into master (c2d6d00) will decrease coverage by 0.21%.
Report is 2 commits behind head on master.
The diff coverage is 81.16%.

@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
- Coverage   84.04%   83.84%   -0.21%     
==========================================
  Files          38       38              
  Lines        7453     7471      +18     
==========================================
  Hits         6264     6264              
- Misses        886      893       +7     
- Partials      303      314      +11     
Files Coverage Δ
config.go 100.00% <ø> (ø)
events.go 0.00% <ø> (ø)
handler_http_stream.go 65.35% <100.00%> (ø)
handler_sockjs.go 82.31% <100.00%> (ø)
handler_sse.go 71.03% <100.00%> (ø)
handler_websocket.go 83.38% <100.00%> (ø)
internal/queue/queue.go 100.00% <ø> (ø)
node.go 92.47% <92.10%> (-0.09%) ⬇️
client.go 80.92% <76.64%> (-0.33%) ⬇️
metrics.go 83.45% <81.67%> (-1.42%) ⬇️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@FZambia FZambia changed the title New metrics metrics, remove locks, channel namespace resolution New metrics, remove locks, channel namespace resolution Oct 20, 2023
@FZambia FZambia changed the title New metrics, remove locks, channel namespace resolution New metrics, remove metric locks, channel namespace resolution Oct 20, 2023
@FZambia FZambia marked this pull request as ready for review October 20, 2023 18:22
@FZambia FZambia changed the title New metrics, remove metric locks, channel namespace resolution Remove metric locks, frame type and channel namespace resolution for transport messages sent/received Oct 22, 2023
@FZambia FZambia merged commit de2232b into master Oct 23, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant