profiling - lefred/mysqlshell-plugins GitHub Wiki
profiling
NAME
profiling - Statement Profiling Object using Performance Schema.
DESCRIPTION
A collection of methods to Profile MySQL Satements
get
Get the profile of a statement.
JS profiling.get()
Profiling of:
-------------
select * from employees.employees where gender='F' limit 5
+------------------------------------------------+----------+
| Stage | Duration |
+------------------------------------------------+----------+
| stage/sql/Executing hook on transaction begin. | 0.0000 |
| stage/sql/cleaning up | 0.0000 |
| stage/sql/checking permissions | 0.0000 |
| stage/sql/Opening tables | 0.0009 |
| stage/sql/init | 0.0000 |
| stage/sql/System lock | 0.0000 |
| stage/sql/optimizing | 0.0000 |
| stage/sql/statistics | 0.0000 |
| stage/sql/preparing | 0.0000 |
| stage/sql/executing | 0.0557 |
| stage/sql/end | 0.0000 |
| stage/sql/query end | 0.0000 |
| stage/sql/waiting for handler commit | 0.0000 |
| stage/sql/closing tables | 0.0000 |
| stage/sql/freeing items | 0.0001 |
| stage/sql/cleaning up | 0.0000 |
+------------------------------------------------+----------+
Don't forget to stop the profiling when done.
start
Start the profiling collection.
JS profiling.start()
Disabling Actors and History for all users.
Enabling Actors and History for root@localhost.
Profiling configured for root@localhost... please use profiling.stop() to stop it
stop
Stop the profiling collection.
JS profiling.stop()
Profiling is now stopped.