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

Add tracking for new metrics in CSV (entity_changes, storage_size) #5780

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MoonBoi9001
Copy link
Member

@MoonBoi9001 MoonBoi9001 commented Jan 22, 2025

This PR introduces tracking for entity count changes and current storage size of entities in BlockStateMetrics.

While the tracking mechanism follows a similar pattern to other metrics (gas, op, read_bytes, write_bytes), there's an important distinction in how the newly introduced metrics entity_changes and storage_size values are recorded:

  • The other metrics use monotonic counters that accumulate totals over time (e.g., total bytes read)
  • The new entity_count_changes metric tracks the net change in entity counts per block (e.g., +5 id_1 added, -2 id_2 removed)
  • The new storage_size metric tracks the actual current size of stored entities as a live readout. If the entity increases/reduces in size due to a write event, then this metric will reflect the new size of the entity after the write event.

For entity_count_changes, each block's measurement represents changes that occurred within that block, not cumulative totals or absolute counts. To determine the total number of entities at a given block, these changes would need to be summed across all previous blocks.

@MoonBoi9001 MoonBoi9001 force-pushed the samuel/gas-metrics-csv branch from dc166bd to a506cd7 Compare January 27, 2025 12:41
@MoonBoi9001 MoonBoi9001 force-pushed the samuel/gas-metrics-csv branch 6 times, most recently from fe52ecd to 0f0540e Compare January 27, 2025 21:06
address CI failures
run format check
@MoonBoi9001 MoonBoi9001 force-pushed the samuel/gas-metrics-csv branch from 0f0540e to ef663d1 Compare January 27, 2025 21:11
@MoonBoi9001 MoonBoi9001 force-pushed the samuel/gas-metrics-csv branch from 46dd177 to 0321c05 Compare January 27, 2025 21:26
@MoonBoi9001 MoonBoi9001 changed the title Add tracking for entity number stats in CSV Add tracking for new metrics in CSV (entity_changes, storage_size) Jan 28, 2025
@MoonBoi9001 MoonBoi9001 marked this pull request as draft February 3, 2025 11:55
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.

1 participant