mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-18 16:40:23 +00:00
Merge branch '3.0' into pt-stalk-collect-prepared-statements-LP1642750
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
#Contributing guide
|
||||
##How Can I Contribute?
|
||||
##Reporting Bugs
|
||||
# Contributing guide
|
||||
## How Can I Contribute?
|
||||
## Reporting Bugs
|
||||
Before creating bug reports, please check this list as you might find out that you don't need to create one. When you create a bug report, please include as many details as possible. You can use this template to structure the information.
|
||||
|
||||
###Before Submitting A Bug Report
|
||||
### Before Submitting A Bug Report
|
||||
- Ensure you have carefully read the documentation. Percona Toolkit is a mature project with many settings that covers a wide range options.
|
||||
- Search for existing bugs in Launchpad to see if the problem has already been reported. If it has, add a comment to the existing issue instead of opening a new one.
|
||||
|
||||
###How Do I Submit A (Good) Bug Report?
|
||||
### How Do I Submit A (Good) Bug Report?
|
||||
- Explain the problem and include additional details to help others reproduce the problem:
|
||||
- Use a clear and descriptive title for the issue to identify the problem.
|
||||
- Describe the exact steps which reproduce the problem, including as many details as possible. Provide examples of the command you used and include context information like language, OS and database versions.
|
||||
Describe the obtained results and the expected results and, if it is possible, provide examples.
|
||||
|
||||
##Submiting fixes
|
||||
###Create an Issue
|
||||
## Submiting fixes
|
||||
### Create an Issue
|
||||
If you find a bug, the first step is to create an issue. Whatever the problem is, you’re likely not the only one experiencing it. Others will find your issue helpful, and other developers might help you find the cause and discuss the best solution for it.
|
||||
|
||||
####Tips for creating an issue
|
||||
#### Tips for creating an issue
|
||||
- Check if there are any existing issues for your problem. By doing this, we can avoid duplicating efforts, since the issue might have been already reported and if not, you might find useful information on older issues related to the same problem.
|
||||
- Be clear about what your problem is: which program were you using, what was the expected result and what is the result you are getting. Detail how someone else can reproduce the problem, including examples.
|
||||
- Include system details like language version, OS, database details or special configurations, etc.
|
||||
- Paste the error output or logs in your issue or in a Gist.
|
||||
|
||||
###Pull Requests
|
||||
### Pull Requests
|
||||
If you fixed a bug or added a new feature – awesome! Open a pull request with the code! Be sure you’ve read any documents on contributing, understand the license and have signed a Contributor Licence Agreement (CLA) if required. Once you’ve submitted a pull request, the maintainers can compare your branch to the existing one and decide whether or not to incorporate (merge) your changes.
|
||||
|
||||
###Tips for creating a pull request
|
||||
### Tips for creating a pull request
|
||||
- Fork the repository and clone it locally. Connect your local to the original ‘upstream’ repository by adding it as a remote. Pull in changes from ‘upstream’ often so that you stay up to date so that when you submit your pull request, merge conflicts will be less likely.
|
||||
- Create a branch for your code. Usually it is a good practice to name the branch after the issue ID, like issue-12345.
|
||||
- Be clear about the problem you fixed or the feature you added. Include explanations and code references to help the maintainers understand what you did.
|
||||
@@ -37,16 +37,16 @@ If you fixed a bug or added a new feature – awesome! Open a pull request with
|
||||
- Be as explicit as possible. Avoid using special/internal language variables like $_. Use a variable name that clearly represents the value it holds.
|
||||
- Write good commit messages. A comment like 'Misc bugfixes' or 'More code added' does not help to understand what's the change about.
|
||||
|
||||
###Open Pull Requests
|
||||
### Open Pull Requests
|
||||
Once you’ve opened a pull request, a discussion will start around your proposed changes. Other contributors and users may chime in, but ultimately the decision is made by the maintainers. You may be asked to make some changes to your pull request, if so, add more commits to your branch and push them – they’ll automatically go into the existing pull request.
|
||||
|
||||
#Licensing
|
||||
# Licensing
|
||||
Along with the pull request, include a message indicating that the submited code is your own creation and it can be distributed under the BSD licence.
|
||||
|
||||
|
||||
#Setting up the development environment
|
||||
# Setting up the development environment
|
||||
|
||||
####Setting up the source code
|
||||
#### Setting up the source code
|
||||
To start, fork the Percona Toolkit repo to be able to submit pull requests and clone it locally:
|
||||
```
|
||||
mkdir ${HOME}/perldev
|
||||
@@ -55,7 +55,7 @@ git clone https://github.com/<your-username>/percona-toolkit.git ${HOME}/perldev
|
||||
|
||||
For testing, we are going to need to have MySQL with slaves. For that, we already have scripts in the sandbox directory but first we need to download MySQL binaries. Please download the Linux Generic tar file for your distrubution from [https://www.percona.com/downloads/Percona-Server-5.6/](https://www.percona.com/downloads/Percona-Server-5.6/).
|
||||
|
||||
###Set up MySQL sandbox
|
||||
### Set up MySQL sandbox
|
||||
In this example, we are going to download Percona Server 5.6.32. Since I am using Ubuntu, according to the documentation [here](https://www.percona.com/doc/percona-server/5.6/installation.html#installing-percona-server-from-a-binary-tarball), I am going to need this tar file: [Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz](https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.32-78.1/binary/tarball/Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz).
|
||||
|
||||
```
|
||||
@@ -67,7 +67,7 @@ wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.32-
|
||||
```
|
||||
tar xvzf Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz --strip 1 -C ${HOME}/mysql/percona-server-5.6.32
|
||||
```
|
||||
###Set up environment variables:
|
||||
### Set up environment variables:
|
||||
We need these environment variables to start the MySQL sandbox and to run the tests. Probably it is a good idea to add them to your `.bashrc` file.
|
||||
```
|
||||
export PERCONA_TOOLKIT_BRANCH=${HOME}/perldev/percona-toolkit
|
||||
@@ -75,7 +75,7 @@ export PERL5LIB=${HOME}/perldev/percona-toolkit/lib
|
||||
export PERCONA_TOOLKIT_SANDBOX=${HOME}/mysql/percona-server-5.6.32
|
||||
```
|
||||
|
||||
###Starting the sandbox
|
||||
### Starting the sandbox
|
||||
```
|
||||
cd ${HOME}/perldev/percona-toolkit
|
||||
```
|
||||
@@ -84,7 +84,7 @@ sandbox/test-env start
|
||||
```
|
||||
To stop the MySQL sandbox: `sandbox/test-env stop`
|
||||
|
||||
###Running tests
|
||||
### Running tests
|
||||
```
|
||||
cd ${HOME}/perldev/percona-toolkit
|
||||
```
|
||||
|
@@ -905,8 +905,8 @@ collect() {
|
||||
log "Loop start: $(date +'TS %s.%N %F %T')"
|
||||
local start_time=$(date +'%s')
|
||||
local curr_time=$start_time
|
||||
local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
|
||||
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e "SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = 'transaction';" | sed '2q;d' | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
|
||||
if [ $ps_instrumentation_enabled != "yes" ]; then
|
||||
log "Performance Schema instrumentation is disabled"
|
||||
fi
|
||||
@@ -953,7 +953,7 @@ collect() {
|
||||
(echo $ts; transactions) >>"$d/$p-transactions" &
|
||||
fi
|
||||
|
||||
if [ $ps_instrumentation_enabled == "yes" ]; then
|
||||
if [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes" ]; then
|
||||
ps_locks_transactions "$d/$p-ps-locks-transactions"
|
||||
fi
|
||||
|
||||
|
@@ -192,7 +192,8 @@ collect() {
|
||||
local curr_time=$start_time
|
||||
local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
|
||||
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
if [ $ps_instrumentation_enabled != "yes" ]; then
|
||||
|
||||
if [ $ps_instrumentation_enabled != "yes"]; then
|
||||
log "Performance Schema instrumentation is disabled"
|
||||
fi
|
||||
|
||||
@@ -245,7 +246,7 @@ collect() {
|
||||
(echo $ts; transactions) >>"$d/$p-transactions" &
|
||||
fi
|
||||
|
||||
if [ $ps_instrumentation_enabled == "yes" ]; then
|
||||
if [ [ "${mysql_version}" '>' "5.6" ] && [ $ps_instrumentation_enabled == "yes"] ]; then
|
||||
ps_locks_transactions "$d/$p-ps-locks-transactions"
|
||||
fi
|
||||
|
||||
|
@@ -1,10 +1,13 @@
|
||||
/* This enables perfomance schema without a server restart */
|
||||
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE NAME = 'events_waits_current';
|
||||
UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME = 'events_waits_current';
|
||||
|
||||
/* Enable instrumentation */
|
||||
UPDATE performance_schema.setup_consumers SET ENABLED='YES' WHERE NAME LIKE '%events_transactions%';
|
||||
UPDATE performance_schema.setup_consumers SET ENABLED='YES' WHERE NAME LIKE '%events_transactions%';
|
||||
UPDATE performance_schema.setup_instruments SET ENABLED='YES' WHERE NAME = 'wait/lock/metadata/sql/mdl';
|
||||
|
||||
UPDATE performance_schema.setup_instruments set ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'wait/lock/metadata/sql/mdl';
|
||||
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'transaction';
|
||||
UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE 'events_transactions%';
|
||||
UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%events_transactions%';
|
||||
FLUSH TABLES;
|
||||
|
||||
CREATE SCHEMA IF NOT EXISTS test;
|
||||
|
||||
|
Reference in New Issue
Block a user