Skip to content

Commit

Permalink
metrics: 简化设计
Browse files Browse the repository at this point in the history
  • Loading branch information
icycrystal4 committed Dec 18, 2023
1 parent 1d43243 commit 6fb63d1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ impl Metric {
pub(crate) fn from(item: *const Item) -> Self {
Self { item }
}
//
// 检查metric是否已经注册到global
pub fn check_registered(&mut self) -> bool {
let registered = self.check_get().is_global();
log::info!("check_registered: {self} {registered}");
registered
self.check_get().is_global()
}
// 部分场景需要依赖Arc<Metric>,又需要对Metric进行+=的更新操作,因此需要将只读metric更新为mut
// 1. 所有的基于metrics的操作都是原子的
Expand Down

0 comments on commit 6fb63d1

Please sign in to comment.