Skip to content

feat: added client metrics timing reporting mechanism (#229)#236

Merged
bigbigxu merged 3 commits intomainfrom
xuen
Sep 2, 2025
Merged

feat: added client metrics timing reporting mechanism (#229)#236
bigbigxu merged 3 commits intomainfrom
xuen

Conversation

@bigbigxu
Copy link
Copy Markdown
Contributor

@bigbigxu bigbigxu commented Sep 2, 2025

No description provided.

Metrics::text_output()
}

pub fn encode() -> CommonResult<Vec<MetricValue>> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this function be called frequently?
There is an nested loop in this function. Maybe that will be an performance black hole.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

todo: make this variable into configuration

pub struct MountValue {
pub info: Arc<MountInfo>,
pub ufs: UfsFileSystem,
pub mount_id: String,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This variable duplicates the mount id in MountInfo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The meaning of this function name is a bit ambiguous

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here, the metric reported by the client will be automatically registered and the metric execution value will be updated.

}

None => err_box!("Prometheus registry not init"),
pub fn name(&self) -> &str {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

get_name maybe better?

@bigbigxu bigbigxu merged commit 8169346 into main Sep 2, 2025
3 checks passed
@lzjqsdd lzjqsdd added the enhancement New feature or request label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants