Skip to content

chore: collect garbage collector metrics #1137

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

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

luislhl
Copy link
Collaborator

@luislhl luislhl commented Sep 18, 2024

Motivation

We want to observe how the garbage collector is behaving, as part of https://github.com/HathorNetwork/internal-issues/issues/379

Acceptance Criteria

  • The main goal is to have metrics to show us how many objects the garbage collector has collected over time and how many objects it's tracking in each moment, but we added some other metrics that seemed nice to have

This is an example of the generated metrics:

# HELP hathor:python_gc_objects Number of objects tracked by the garbage collector
# TYPE hathor:python_gc_objects gauge
hathor:python_gc_objects{generation="0"} 80.0
hathor:python_gc_objects{generation="1"} 10.0
hathor:python_gc_objects{generation="2"} 14.0
# HELP hathor:python_gc_collections Number of collections done by the garbage collector
# TYPE hathor:python_gc_collections gauge
hathor:python_gc_collections{generation="0"} 1671.0
hathor:python_gc_collections{generation="1"} 151.0
hathor:python_gc_collections{generation="2"} 10.0
# HELP hathor:python_gc_collected Number of objects collected by the garbage collector
# TYPE hathor:python_gc_collected gauge
hathor:python_gc_collected{generation="0"} 162881.0
hathor:python_gc_collected{generation="1"} 33275.0
hathor:python_gc_collected{generation="2"} 13530.0
# HELP hathor:python_gc_uncollectable Number of objects that could not be collected by the garbage collector
# TYPE hathor:python_gc_uncollectable gauge
hathor:python_gc_uncollectable{generation="0"} 0.0
hathor:python_gc_uncollectable{generation="1"} 0.0
hathor:python_gc_uncollectable{generation="2"} 0.0
# HELP hathor:python_gc_threshold Current threshold of the garbage collector
# TYPE hathor:python_gc_threshold gauge
hathor:python_gc_threshold{generation="0"} 700.0
hathor:python_gc_threshold{generation="1"} 10.0
hathor:python_gc_threshold{generation="2"} 10.0

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@luislhl luislhl self-assigned this Sep 18, 2024
Copy link

github-actions bot commented Sep 18, 2024

🐰 Bencher Report

Branchchore/collect-garbage-collector-metrics
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Lower Boundary
nanoseconds (ns)
(Limit %)
Upper Boundary
nanoseconds (ns)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
101,458,788,784.58
(-0.56%)
91,826,155,535.83
(90.51%)
112,231,967,877.12
(90.40%)
🐰 View full continuous benchmarking report in Bencher

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.37%. Comparing base (8da62a1) to head (ce64361).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1137      +/-   ##
==========================================
- Coverage   84.43%   84.37%   -0.07%     
==========================================
  Files         317      317              
  Lines       24366    24384      +18     
  Branches     3705     3707       +2     
==========================================
  Hits        20574    20574              
- Misses       3078     3091      +13     
- Partials      714      719       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@luislhl luislhl enabled auto-merge (squash) October 7, 2024 22:29
@luislhl luislhl force-pushed the chore/collect-garbage-collector-metrics branch from ef67638 to ce64361 Compare October 7, 2024 22:29
@luislhl luislhl merged commit 22f478c into master Oct 7, 2024
12 of 13 checks passed
@luislhl luislhl deleted the chore/collect-garbage-collector-metrics branch October 7, 2024 22:53
@jansegre jansegre mentioned this pull request Oct 14, 2024
2 tasks
@jansegre jansegre mentioned this pull request Dec 11, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants