mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-03 09:35:41 +00:00
add stats metrics (#1207)
support new cli command `easytier-cli stats` It's useful to find out which components are consuming bandwidth.
This commit is contained in:
@@ -78,6 +78,14 @@ impl ServiceRegistry {
|
||||
self.table.insert(key, entry);
|
||||
}
|
||||
|
||||
pub fn get_method_name(&self, rpc_desc: &RpcDescriptor) -> Option<String> {
|
||||
let service_key = ServiceKey::from(rpc_desc);
|
||||
let entry = self.table.get(&service_key)?;
|
||||
let method_index = rpc_desc.method_index as u8;
|
||||
let method_name = entry.service.get_method_name(method_index).ok()?;
|
||||
Some(method_name)
|
||||
}
|
||||
|
||||
pub fn unregister<H: Handler<Controller = RpcController>>(
|
||||
&self,
|
||||
h: H,
|
||||
|
||||
Reference in New Issue
Block a user