-
Notifications
You must be signed in to change notification settings - Fork 58
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
Drop rpc replace metrics #2670
base: main
Are you sure you want to change the base?
Drop rpc replace metrics #2670
Conversation
3786eb7
to
cb994a9
Compare
63cd487
to
b0761aa
Compare
b0761aa
to
35433fc
Compare
ant-service-management/src/metric.rs
Outdated
for sample in scrape.samples.iter() { | ||
for (key, value) in sample.labels.iter() { | ||
match key.as_str() { | ||
"peer_id" => node_info.peer_id = value.parse().unwrap(), |
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.
We don't use unwrap
or expect
in our code as it may cause the program to crash instantly, we should return error types here.
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.
All the unwraps have to be removed.
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.
Done
@@ -13,6 +13,7 @@ pub mod error; | |||
pub mod faucet; | |||
pub mod node; | |||
pub mod rpc; |
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 think all the references to rpc
should be removed from our codebase.
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.
ant-service-management has dependency on ant-node-rpc-client module of our source, should i refactor there as well?, i left it intact so that existing changes with ant-node-rpc-client are not broken! or else, i will have to remove them as well!
ant-service-management/src/metric.rs
Outdated
impl RpcActions for MetricClient { | ||
async fn node_info(&self) -> Result<NodeInfo> { |
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.
Regarding the Action
here:
- We must rename
RpcActions
->MetricActions
- remove the unused methods
- Also the
expect
has to be removed.
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.
Yeah, I was also puzzled about the use of RpcActions
. We shouldn't have references to RPC any more.
cb8c46f
to
db7c11b
Compare
7f6233c
to
d7e2457
Compare
d7e2457
to
f884154
Compare
f884154
to
405c596
Compare
895fdd5
to
fe24576
Compare
c3851ea
to
c92f726
Compare
Description
ant-node-manager currently uses rpc server to collect node_information and network_information, replace the rpc server with metric server.
Related Issue
Fixes #<issue_number> (if applicable).
Type of Change
Please mark the types of changes made in this pull request.
Checklist
Please ensure all of the following tasks have been completed: