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

Unifying c2s metrics #3967

Merged
merged 12 commits into from
Feb 22, 2023
Merged

Unifying c2s metrics #3967

merged 12 commits into from
Feb 22, 2023

Conversation

DenysGonchar
Copy link
Collaborator

@DenysGonchar DenysGonchar commented Feb 20, 2023

this PR introduces the following changes:

  • removed global.data.xmpp.*.compressed_size metrics - compression support is removed a while ago.
  • removed global.data.xmpp.*.encrypted_size metrics - the size of a stanza doesn't change much after encryption, more over, when encryption is done for a batch of stanza then this metric is completely irrelevant.
  • improved global.data.xmpp.*.xml_stanza_size reporting - this histogram metrics make sense only when reported for a single stanza, this PR ensures that.
  • introduced global.data.xmpp.*.c2s*.raw spiral metrics for TCP/TLS/BOSH/WebSockets - firstly spiral calculation makes much more sense than histogram in addition to that it's less expensive, in the upcoming PR support for S2S and XMPP components traffic calculation will be added.
  • removed support of mongoose_transport for bosh socket - that's not needed any more, the same should be done for websockets in the following PR (as well as support of websockets connection for XMPP components)

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Base: 83.46% // Head: 83.55% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (149d420) compared to base (56f756c).
Patch coverage: 95.83% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3967      +/-   ##
==========================================
+ Coverage   83.46%   83.55%   +0.08%     
==========================================
  Files         538      538              
  Lines       34003    34001       -2     
==========================================
+ Hits        28382    28409      +27     
+ Misses       5621     5592      -29     
Impacted Files Coverage Δ
src/c2s/mongoose_c2s_socket.erl 83.33% <ø> (ø)
src/ejabberd_receiver.erl 72.58% <ø> (-0.22%) ⬇️
src/mod_bosh_socket.erl 78.32% <83.33%> (+2.06%) ⬆️
src/c2s/mongoose_c2s.erl 87.44% <100.00%> (+0.08%) ⬆️
src/c2s/mongoose_c2s_ranch.erl 94.82% <100.00%> (+0.38%) ⬆️
src/metrics/mongoose_metrics.erl 92.70% <100.00%> (+0.03%) ⬆️
src/mod_bosh.erl 95.74% <100.00%> (+0.06%) ⬆️
src/mod_websockets.erl 81.92% <100.00%> (+0.33%) ⬆️
src/ejabberd.erl 50.00% <0.00%> (-5.00%) ⬇️
src/domain/service_domain_db.erl 83.33% <0.00%> (-2.09%) ⬇️
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mongoose-im

This comment was marked as outdated.

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally very happy with all the changes, the only thing is that some are kinda breaking ones so they need documentation and potentially migration, which is something @chrzaszcz is working on. Dunno how do you want to proceed with that but apart from docs, this PR is exactly what I wanted, thank you so much 🎉

@DenysGonchar
Copy link
Collaborator Author

I'm generally very happy with all the changes, the only thing is that some are kinda breaking ones so they need documentation and potentially migration, which is something @chrzaszcz is working on. Dunno how do you want to proceed with that but apart from docs, this PR is exactly what I wanted, thank you so much 🎉

I was going to add documentation in the upcoming PR, when all the metrics are added (incl. s2s and xmpp components connections)

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, I added a few comments. There is a need to update migration guide for metrics, but we could do it later.

@@ -456,7 +456,7 @@ configure_mod_vcard(Config) ->
ldap_opts() ->
LDAPOpts = #{filter => <<"(objectClass=inetOrgPerson)">>,
base => <<"ou=Users,dc=esl,dc=com">>,
search_fields => [{"Full Name", "cn"}, {"User", "uid"}],
search_fields => [{<<"Full Name">>, <<"cn">>}, {<<"User">>, <<"uid">>}],
vcard_map => [{"FN", "%s", ["cn"]}]},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: these should be binaries too.

@@ -163,10 +163,6 @@ Metrics specific to an extension, e.g. Message Archive Management, are described
| ----------- | ---- | ----------- |
| `[global, data, xmpp, received, xml_stanza_size]` | histogram | A size (in bytes) of a received stanza after decompression and decryption. |
| `[global, data, xmpp, sent, xml_stanza_size]` | histogram | A size (in bytes) of a stanza sent to a client socket. |
| `[global, data, xmpp, received, compressed_size]` | histogram | A size (in bytes) of a received stanza before decompression. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe describe all new metrics?

@@ -34,6 +34,18 @@
modPrivacyStanzaAll
]).

-define(GLOBAL_SPIRALS, [
%% TBD report raw data metrics for s2s and components conection
[data, xmpp, received, c2s, tcp, raw],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any plans for other suffixes than raw? It seems that it does not add much value since it is always the same.

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed with @DenysGonchar that the comments will be addressed in a separate PR.

@chrzaszcz chrzaszcz merged commit b9ca80e into master Feb 22, 2023
@chrzaszcz chrzaszcz deleted the unifying-c2s-metrics branch February 22, 2023 09:58
@jacekwegr jacekwegr added this to the 6.1.0 milestone Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants