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 bloom filter metrics to the p2p sdk #2612

Merged
merged 13 commits into from
Jan 19, 2024
Merged

Conversation

ceyonur
Copy link
Contributor

@ceyonur ceyonur commented Jan 16, 2024

Why this should be merged

Adds bloom filter metrics. Currently only reset count is tracked.

Closes: ava-labs/coreth#454

How this works

  • NewBloomFilter takes registerer as input and creates metrics.
  • In each successful reset, reset metric count is incremented.

How this was tested

Added UT.

P-chain:

# HELP avalanche_P_vm_mempool_bloom_filter_count Number of additions that have been performed to the bloom
# TYPE avalanche_P_vm_mempool_bloom_filter_count gauge
avalanche_P_vm_mempool_bloom_filter_count 0
# HELP avalanche_P_vm_mempool_bloom_filter_entries Number of bytes allocated to slots in the bloom
# TYPE avalanche_P_vm_mempool_bloom_filter_entries gauge
avalanche_P_vm_mempool_bloom_filter_entries 9815
# HELP avalanche_P_vm_mempool_bloom_filter_hashes Number of hashes in the bloom
# TYPE avalanche_P_vm_mempool_bloom_filter_hashes gauge
avalanche_P_vm_mempool_bloom_filter_hashes 7
# HELP avalanche_P_vm_mempool_bloom_filter_max_count Maximum number of additions that should be performed to the bloom before resetting
# TYPE avalanche_P_vm_mempool_bloom_filter_max_count gauge
avalanche_P_vm_mempool_bloom_filter_max_count 11836
# HELP avalanche_P_vm_mempool_bloom_filter_reset_count Number times the bloom has been reset
# TYPE avalanche_P_vm_mempool_bloom_filter_reset_count counter
avalanche_P_vm_mempool_bloom_filter_reset_count 1

X-chain:

# HELP avalanche_X_vm_avalanche_mempool_bloom_filter_count Number of additions that have been performed to the bloom
# TYPE avalanche_X_vm_avalanche_mempool_bloom_filter_count gauge
avalanche_X_vm_avalanche_mempool_bloom_filter_count 0
# HELP avalanche_X_vm_avalanche_mempool_bloom_filter_entries Number of bytes allocated to slots in the bloom
# TYPE avalanche_X_vm_avalanche_mempool_bloom_filter_entries gauge
avalanche_X_vm_avalanche_mempool_bloom_filter_entries 9815
# HELP avalanche_X_vm_avalanche_mempool_bloom_filter_hashes Number of hashes in the bloom
# TYPE avalanche_X_vm_avalanche_mempool_bloom_filter_hashes gauge
avalanche_X_vm_avalanche_mempool_bloom_filter_hashes 7
# HELP avalanche_X_vm_avalanche_mempool_bloom_filter_max_count Maximum number of additions that should be performed to the bloom before resetting
# TYPE avalanche_X_vm_avalanche_mempool_bloom_filter_max_count gauge
avalanche_X_vm_avalanche_mempool_bloom_filter_max_count 11836
# HELP avalanche_X_vm_avalanche_mempool_bloom_filter_reset_count Number times the bloom has been reset
# TYPE avalanche_X_vm_avalanche_mempool_bloom_filter_reset_count counter
avalanche_X_vm_avalanche_mempool_bloom_filter_reset_count 1

C-chain:

# HELP avalanche_C_vm_sdk_atomic_mempool_bloom_filter_count Number of additions that have been performed to the bloom
# TYPE avalanche_C_vm_sdk_atomic_mempool_bloom_filter_count gauge
avalanche_C_vm_sdk_atomic_mempool_bloom_filter_count 0
# HELP avalanche_C_vm_sdk_atomic_mempool_bloom_filter_entries Number of bytes allocated to slots in the bloom
# TYPE avalanche_C_vm_sdk_atomic_mempool_bloom_filter_entries gauge
avalanche_C_vm_sdk_atomic_mempool_bloom_filter_entries 9815
# HELP avalanche_C_vm_sdk_atomic_mempool_bloom_filter_hashes Number of hashes in the bloom
# TYPE avalanche_C_vm_sdk_atomic_mempool_bloom_filter_hashes gauge
avalanche_C_vm_sdk_atomic_mempool_bloom_filter_hashes 7
# HELP avalanche_C_vm_sdk_atomic_mempool_bloom_filter_max_count Maximum number of additions that should be performed to the bloom before resetting
# TYPE avalanche_C_vm_sdk_atomic_mempool_bloom_filter_max_count gauge
avalanche_C_vm_sdk_atomic_mempool_bloom_filter_max_count 11836
# HELP avalanche_C_vm_sdk_atomic_mempool_bloom_filter_reset_count Number times the bloom has been reset
# TYPE avalanche_C_vm_sdk_atomic_mempool_bloom_filter_reset_count counter
avalanche_C_vm_sdk_atomic_mempool_bloom_filter_reset_count 1
# HELP avalanche_C_vm_sdk_eth_tx_bloom_filter_count Number of additions that have been performed to the bloom
# TYPE avalanche_C_vm_sdk_eth_tx_bloom_filter_count gauge
avalanche_C_vm_sdk_eth_tx_bloom_filter_count 0
# HELP avalanche_C_vm_sdk_eth_tx_bloom_filter_entries Number of bytes allocated to slots in the bloom
# TYPE avalanche_C_vm_sdk_eth_tx_bloom_filter_entries gauge
avalanche_C_vm_sdk_eth_tx_bloom_filter_entries 9815
# HELP avalanche_C_vm_sdk_eth_tx_bloom_filter_hashes Number of hashes in the bloom
# TYPE avalanche_C_vm_sdk_eth_tx_bloom_filter_hashes gauge
avalanche_C_vm_sdk_eth_tx_bloom_filter_hashes 7
# HELP avalanche_C_vm_sdk_eth_tx_bloom_filter_max_count Maximum number of additions that should be performed to the bloom before resetting
# TYPE avalanche_C_vm_sdk_eth_tx_bloom_filter_max_count gauge
avalanche_C_vm_sdk_eth_tx_bloom_filter_max_count 11836
# HELP avalanche_C_vm_sdk_eth_tx_bloom_filter_reset_count Number times the bloom has been reset
# TYPE avalanche_C_vm_sdk_eth_tx_bloom_filter_reset_count counter
avalanche_C_vm_sdk_eth_tx_bloom_filter_reset_count 1

@ceyonur ceyonur added the monitoring This primarily focuses on logs, metrics, and/or tracing label Jan 16, 2024
@ceyonur ceyonur self-assigned this Jan 16, 2024
@ceyonur ceyonur marked this pull request as draft January 16, 2024 13:16
@ceyonur ceyonur marked this pull request as ready for review January 16, 2024 18:53
@StephenButtolph StephenButtolph changed the base branch from dev to master January 19, 2024 15:33
@StephenButtolph StephenButtolph changed the title add bloom filter metrics Add bloom filter metrics to the p2p sdk Jan 19, 2024
@StephenButtolph StephenButtolph self-assigned this Jan 19, 2024
@StephenButtolph StephenButtolph added this to the v1.10.19 milestone Jan 19, 2024
utils/bloom/metrics.go Show resolved Hide resolved
@StephenButtolph StephenButtolph added this pull request to the merge queue Jan 19, 2024
Merged via the queue into master with commit 9b302a5 Jan 19, 2024
17 checks passed
@StephenButtolph StephenButtolph deleted the bloomfilter-metrics branch January 19, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monitoring This primarily focuses on logs, metrics, and/or tracing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add metrics for bloom filter reset
4 participants