Conversation
| Metrics::text_output() | ||
| } | ||
|
|
||
| pub fn encode() -> CommonResult<Vec<MetricValue>> { |
There was a problem hiding this comment.
Will this function be called frequently?
There is an nested loop in this function. Maybe that will be an performance black hole.
There was a problem hiding this comment.
This is to obtain the metrics that need to be reported. The call is not frequent and is sent once every 10 seconds by default.
| } | ||
|
|
||
| impl CurvineFileSystem { | ||
| pub const CLOSE_TIMEOUT_SECS: u64 = 5; |
There was a problem hiding this comment.
todo: make this variable into configuration
| pub struct MountValue { | ||
| pub info: Arc<MountInfo>, | ||
| pub ufs: UfsFileSystem, | ||
| pub mount_id: String, |
There was a problem hiding this comment.
This variable duplicates the mount id in MountInfo
There was a problem hiding this comment.
The default mount id is u32 type, which is used to reduce memory copying.
| Metrics::text_output() | ||
| } | ||
|
|
||
| pub fn get_or_register(&self, value: &MetricValue) -> CommonResult<CounterVec> { |
There was a problem hiding this comment.
The meaning of this function name is a bit ambiguous
There was a problem hiding this comment.
Here, the metric reported by the client will be automatically registered and the metric execution value will be updated.
orpc/src/common/metrics.rs
Outdated
| } | ||
|
|
||
| None => err_box!("Prometheus registry not init"), | ||
| pub fn name(&self) -> &str { |
No description provided.