Skip to content
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

可用区内资源数量监控 #391

Merged
merged 4 commits into from
Nov 17, 2023
Merged

可用区内资源数量监控 #391

merged 4 commits into from
Nov 17, 2023

Conversation

parabala
Copy link
Collaborator

与#383的区别是:#383采用全局变量+lock,只推0;本方案是开启可用区,则可用区内的资源数量都推,按资源/端口维度推监控

@parabala parabala force-pushed the region_resmis_metric2 branch from 47b025e to 5a04f66 Compare November 16, 2023 03:14
@@ -41,6 +49,10 @@ impl<T: ToNumber> MetricData for T {
fn incr_to_cache(self, id: &Arc<Id>) {
crate::register_cache(id, self.int());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加个set方法更合适吧

}

distance::host_region()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥返回string呢?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与distance::host_region()保持一致;distance::host_region()返回string的原因是返回str会报错;

} else {
0 // region功能关闭时,len_region为0,也就是不输出监控数据;可用区从打开到关闭场景,0也要生成监控数据,覆盖已有的同path旧数据
};
metrics::resource_num_metric(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加的指标数量会不会太多,内存总量有上升吗?指标动态创建会有瞬时的较大内存申请

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从tcp copy环境看没有肉眼可见的增加

return region.clone();
}

return "cnx".to_string();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这也可以不用string吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回&str有编译报错

};

metric += n;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可用区指标相关不应放在host下吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没合适的位置;新增一个文件似乎也不值当。有建议的地方吗?

@parabala parabala merged commit 77808fc into dev Nov 17, 2023
1 check passed
@parabala parabala deleted the region_resmis_metric2 branch January 24, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants