Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
refactor(metrics): separate metrics recorder impl from the server #2561
refactor(metrics): separate metrics recorder impl from the server #2561
Changes from 8 commits
ce016e3
95054c5
fa35210
139f5a7
38c27c9
2cf399f
85c65af
fd3b89d
06df0d0
f8bdbe1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Check warning on line 304 in bin/torii/src/main.rs
Codecov / codecov/patch
bin/torii/src/main.rs#L300-L304
Check warning on line 102 in crates/katana/node/src/lib.rs
Codecov / codecov/patch
crates/katana/node/src/lib.rs#L102
Check warning on line 109 in crates/katana/node/src/lib.rs
Codecov / codecov/patch
crates/katana/node/src/lib.rs#L108-L109
Check warning on line 112 in crates/katana/node/src/lib.rs
Codecov / codecov/patch
crates/katana/node/src/lib.rs#L111-L112
Check warning on line 157 in crates/katana/node/src/lib.rs
Codecov / codecov/patch
crates/katana/node/src/lib.rs#L157
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.
🛠️ Refactor suggestion
Ohayo, sensei! Remove unnecessary assignment to
_
Assigning the result to
_
is unnecessary when using the?
operator. You can directly call the function and let the?
operator handle any errors.Apply this diff:
📝 Committable suggestion
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.
🛠️ Refactor suggestion
Ohayo again, sensei! The Exporter trait looks solid, with a small suggestion.
The
Exporter
trait is well-defined and documented. TheClone + Send + Sync
bounds ensure thread safety, which is crucial for metrics systems. Theexport
method signature is clear and straightforward.One small suggestion to consider:
You might want to make the
export
method more flexible by allowing parameters. For example:This would allow users to specify different export formats if needed in the future, while maintaining backwards compatibility with the current implementation.
Check warning on line 33 in crates/metrics/src/exporters/prometheus.rs
Codecov / codecov/patch
crates/metrics/src/exporters/prometheus.rs#L25-L33
Check warning on line 35 in crates/metrics/src/exporters/prometheus.rs
Codecov / codecov/patch
crates/metrics/src/exporters/prometheus.rs#L35
Check warning on line 40 in crates/metrics/src/exporters/prometheus.rs
Codecov / codecov/patch
crates/metrics/src/exporters/prometheus.rs#L37-L40
Check warning on line 45 in crates/metrics/src/exporters/prometheus.rs
Codecov / codecov/patch
crates/metrics/src/exporters/prometheus.rs#L43-L45
Check warning on line 51 in crates/metrics/src/exporters/prometheus.rs
Codecov / codecov/patch
crates/metrics/src/exporters/prometheus.rs#L49-L51
Check warning on line 22 in crates/metrics/src/lib.rs
Codecov / codecov/patch
crates/metrics/src/lib.rs#L22
Check warning on line 45 in crates/metrics/src/lib.rs
Codecov / codecov/patch
crates/metrics/src/lib.rs#L43-L45
Check warning on line 11 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L6-L11
Check warning on line 14 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L14
Check warning on line 17 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L16-L17
Check warning on line 20 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L19-L20
Check warning on line 23 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L22-L23
Check warning on line 26 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L26
Check warning on line 30 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L28-L30
Check warning on line 33 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L32-L33
Check warning on line 36 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L36
Check warning on line 40 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L38-L40
Check warning on line 43 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L42-L43
Check warning on line 46 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L46
Check warning on line 50 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L48-L50
Check warning on line 53 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L52-L53
Check warning on line 56 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L56
Check warning on line 60 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L58-L60
Check warning on line 63 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L62-L63
Check warning on line 66 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L66
Check warning on line 70 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L68-L70
Check warning on line 73 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L72-L73
Check warning on line 76 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L76
Check warning on line 81 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L78-L81
Check warning on line 84 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L84
Check warning on line 116 in crates/metrics/src/process.rs
Codecov / codecov/patch
crates/metrics/src/process.rs#L116