-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix(metrics): removed influx and added l2_state_size data #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_directory_size function looks efficient overall, but here are a few points to consider to ensure it doesn’t introduce unnecessary overhead:
- Error Handling: The function currently ignores errors when reading directory entries or fetching metadata.
- Concurrency: If the directory contains a large number of files or deeply nested structures, processing them sequentially could become a bottleneck. Consider using a concurrent approach to traverse the directory entries in parallel.
- Metrics Frequency Consideration: Since this function is used for metrics, consider how frequently these metrics need to be collected. If the function is called frequently, ensure that it does not introduce significant performance overhead.
CHANGELOG.md
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
## Next release | |||
|
|||
- fix(metrics): removed influx and added l2_state_size endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: its not really an endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i forgot to change this
@@ -125,3 +125,24 @@ pub fn trim_hash(hash: &Felt) -> String { | |||
|
|||
format!("{}...{}", prefix, suffix) | |||
} | |||
|
|||
pub fn get_directory_size(path: &Path) -> u64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if we were using https://docs.rs/rocksdb/latest/rocksdb/struct.DBCommon.html#method.get_column_family_metadata_cf
which returns, for a given column, its size as
pub struct ColumnFamilyMetaData {
// The size of this column family in bytes, which is equal to the sum of
// the file size of its "levels".
pub size: u64,
// The name of the column family.
pub name: String,
// The number of files in this column family.
pub file_count: usize,
}
Plus, we can do a sum
gauge and a individual gauge for each column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect :)
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
What is the current behavior?
Resolves: #NA
What is the new behavior?
Does this introduce a breaking change?
Other information