forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scheduler API to get CPU stats for current task
Summary: This is part 1 of the change to add CPU stats to the slow log report. Differential Revision: D52791917 fbshipit-source-id: 2df865d ----------------------------------------------------------------------------------------------- Add api to fetch wait stats for cpu scheduler Summary: We want to fetch the wait stats for the worker threads and publish it to the slow logs. Differential Revision: D53984553 fbshipit-source-id: 1efdceb ----------------------------------------------------------------------------------------------- Add additional CPU scheduler APIs Summary: Introduce a few APIs to cover the scenarios for thrift plugin and child mysql tasks. - `tp_create_connection` takes additional parameter whether or not to acquire connection slot against `thread_pool_max_db_connections` and the resource shape quota. The child tasks would set this parameter to `false`. - `tp_is_scheduler_enabled` helps determine if the scheduler is enabled or not. If not, the code should fall back to the other APIs (mysql or thrift). - `tp_get_current_task_connection` returns connection of the current task, from which the tenant id could be obtained and used to enqueue child tasks. - `tp_get_tenant_id` looks up tenant id by db name and allows enqueueing a task without `THD` or `TpConn` which would need to be created/found on the task itself, and then attached. Another small change is to get rid of the assert in `THD::get_connection_attr`. The scheduler could call this API when it is about to enqueue a new task for a `THD` which is done from a random thread. The `THD` in question doesn't have any current thread at that moment so it is safe to call this API and access the memory. Differential Revision: D53980947 fbshipit-source-id: 2ef3d6f
- Loading branch information
1 parent
4214165
commit 326d9b1
Showing
6 changed files
with
151 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters