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

feat: track time to publish a message #451

Merged
merged 3 commits into from
Jul 20, 2023
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jul 16, 2023

Motivation

  • I'd like to know how much time to publish a message at gossipsub side

Description

  • Add msgPublishMs metric and track it

related to #344

@twoeths twoeths requested a review from a team as a code owner July 16, 2023 08:06
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2023

Codecov Report

Patch coverage: 37.50% and project coverage change: -0.06 ⚠️

Comparison is base (89c82f6) 82.36% compared to head (f42ba27) 82.30%.

❗ Current head f42ba27 differs from pull request most recent head 14f3e71. Consider uploading reports for the commit 14f3e71 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #451      +/-   ##
==========================================
- Coverage   82.36%   82.30%   -0.06%     
==========================================
  Files          48       48              
  Lines       12013    12035      +22     
  Branches     1279     1281       +2     
==========================================
+ Hits         9894     9905      +11     
- Misses       2119     2130      +11     
Impacted Files Coverage Δ
src/metrics.ts 18.33% <0.00%> (-0.31%) ⬇️
src/index.ts 70.00% <100.00%> (+0.18%) ⬆️

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

wemeetagain
wemeetagain previously approved these changes Jul 16, 2023
@twoeths
Copy link
Contributor Author

twoeths commented Jul 20, 2023

we can track metric in ns, however if it takes <1ms consistently to publish data then I suppose we don't have a big performance issue here

@twoeths twoeths merged commit 83b8e61 into master Jul 20, 2023
@twoeths twoeths deleted the tuyen/track_publish_time branch July 20, 2023 03:05
/** Total time in millisecond to publish a message */
msgPublishMs: register.histogram<{ topic: TopicLabel }>({
name: 'gossipsub_msg_publish_ms',
help: 'Total time in millisecond to publish a message',
Copy link
Contributor

@dapplion dapplion Jul 20, 2023

Choose a reason for hiding this comment

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

Prometheus standards suggest to use standard metrics, in the case of time seconds: https://prometheus.io/docs/practices/naming/#base-units we should respect the standard as it's used across all our codebase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

4 participants