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

feat: support collect statistics about the engine #1451

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

ShiKaiWi
Copy link
Member

Rationale

Close #1438.

Detailed Changes

Support report statistics on shard level.

Test Plan

New unit tests is added and the CI should pass.

@@ -234,6 +242,63 @@ impl TableEngine for TableEngineImpl {

self.close_tables_of_shard(close_requests).await
}

async fn report_statistics(&self) -> Result<Option<TableEngineStats>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think of one issue when using prometheus metrics to collect stats here, when a shard is transferred to another node, this metrics will remain, so you may collect those table twice.

Copy link
Member Author

Choose a reason for hiding this comment

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

This case has been taken into consideration, and the solution is that a filter based on shards will be applied when reporting to meta.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, a better way I can think of is to register those metrics when open shard, and unregister them when close shard.

@ShiKaiWi ShiKaiWi merged commit 5ec187e into apache:main Jan 26, 2024
6 checks passed
@ShiKaiWi ShiKaiWi deleted the shard-metrics branch January 26, 2024 07:29
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.

Statistics about the shards' loads and instance's load
2 participants