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

Support user level resource tracker #2708

Closed
Tracked by #2718
zhang2014 opened this issue Nov 8, 2021 · 2 comments
Closed
Tracked by #2718

Support user level resource tracker #2708

zhang2014 opened this issue Nov 8, 2021 · 2 comments
Labels
A-query Area: databend query C-feature Category: feature

Comments

@zhang2014
Copy link
Member

zhang2014 commented Nov 8, 2021

Summary

We need to support user level statistics for MemoryTracker and other related trackers

@zhang2014
Copy link
Member Author

Tracker has the following levels:

  • Global tracker(created by databend main macro)
  • User tracker(share for a user multiple queries)
  • Session tracker

@zhang2014
Copy link
Member Author

We only need to create multiple MemoryTracker and use parent to combine them

let global_tracker = MemoryTracker::create(None /*no parent*/);
let user_tracker = MemoryTracker::create(Some(global_tracker.clone()));
let session_tracker = MemoryTracker::create(Some(user_tracker.clone()));

https://github.com/datafuselabs/databend/blob/d04fbead64d5393566e6145e35250b6903be78ad/common/base/src/runtime_tracker.rs#L65-L90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query C-feature Category: feature
Projects
None yet
Development

No branches or pull requests

2 participants