mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 02:34:19 +00:00
Continue work on build-packages. Add replace-text. Make some tools' descriptions one line so build-packages can parse them easily.
This commit is contained in:
@@ -3,4 +3,5 @@ docs/dev/*
|
||||
docs/user/html
|
||||
docs/test-coverage/db
|
||||
docs/test-coverage/html
|
||||
release
|
||||
.DS_Store
|
||||
|
1
MANIFEST
1
MANIFEST
@@ -43,3 +43,4 @@ bin/pt-upgrade
|
||||
bin/pt-usl
|
||||
bin/pt-variable-advisor
|
||||
bin/pt-visual-explain
|
||||
docs/percona-toolkit.pod
|
||||
|
@@ -13690,8 +13690,7 @@ if ( !caller ) { exit main(@ARGV); }
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pt-query-digest - Analyze query execution logs and generate a query report,
|
||||
filter, replay, or transform queries for MySQL, PostgreSQL, memcached, and more.
|
||||
pt-query-digest - Analyze query execution logs and generate a query report, filter, replay, or transform queries for MySQL, PostgreSQL, memcached, and more.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@@ -2267,8 +2267,7 @@ if ( !caller ) { exit main(@ARGV); }
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pt-query-profiler - Execute SQL statements and print statistics, or measure
|
||||
activity caused by other processes.
|
||||
pt-query-profiler - Execute SQL statements and print statistics, or measure activity caused by other processes.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@@ -1841,8 +1841,7 @@ if ( !caller ) { exit main(@ARGV); }
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pt-show-grants - Canonicalize and print MySQL grants so you can effectively
|
||||
replicate, compare and version-control them.
|
||||
pt-show-grants - Canonicalize and print MySQL grants so you can effectively replicate, compare and version-control them.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@@ -7092,8 +7092,7 @@ if ( !caller ) { exit main(@ARGV); }
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pt-table-checksum - Perform an online replication consistency check, or
|
||||
checksum MySQL tables efficiently on one or many servers.
|
||||
pt-table-checksum - Perform an online replication consistency check, or checksum MySQL tables efficiently on one or many servers.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@@ -2036,8 +2036,7 @@ exit main(@ARGV) unless caller;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pt-tcp-model - Transform tcpdump into metrics that permit performance and
|
||||
scalability modeling.
|
||||
pt-tcp-model - Transform tcpdump into metrics that permit performance and scalability modeling.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@@ -25,14 +25,166 @@ This release of Percona Toolkit includes the following tools:
|
||||
|
||||
=over
|
||||
|
||||
=item * pt-archiver
|
||||
=item pt-align
|
||||
|
||||
Archive data.
|
||||
Read lines and split them into words.
|
||||
|
||||
=item pt-archiver
|
||||
|
||||
Archive rows from a MySQL table into another table or a file.
|
||||
|
||||
=item pt-checksum-filter
|
||||
|
||||
Filter checksums from pt-table-checksum.
|
||||
|
||||
=item pt-collect
|
||||
|
||||
Collect information from a server for some period of time.
|
||||
|
||||
=item pt-config-diff
|
||||
|
||||
Diff MySQL configuration files and server variables.
|
||||
|
||||
=item pt-deadlock-logger
|
||||
|
||||
Extract and log MySQL deadlock information.
|
||||
|
||||
=item pt-diskstats
|
||||
|
||||
Read a file generated from /proc/diskstats and summarize it.
|
||||
|
||||
=item pt-duplicate-key-checker
|
||||
|
||||
Find duplicate indexes and foreign keys on MySQL tables.
|
||||
|
||||
=item pt-fifo-split
|
||||
|
||||
Split files and pipe lines to a fifo without really splitting.
|
||||
|
||||
=item pt-find
|
||||
|
||||
Find MySQL tables and execute actions, like GNU find.
|
||||
|
||||
=item pt-fk-error-logger
|
||||
|
||||
Extract and log MySQL foreign key errors.
|
||||
|
||||
=item pt-heartbeat
|
||||
|
||||
Monitor MySQL replication delay.
|
||||
|
||||
=item pt-index-usage
|
||||
|
||||
Read queries from a log and analyze how they use indexes.
|
||||
|
||||
=item pt-kill
|
||||
|
||||
Kill MySQL queries that match certain criteria.
|
||||
|
||||
=item pt-log-player
|
||||
|
||||
Replay MySQL query logs.
|
||||
|
||||
=item pt-mext
|
||||
|
||||
Aggregate and summarize mysqladmin extended output.
|
||||
|
||||
=item pt-mysql-summary
|
||||
|
||||
Summarize MySQL information in a nice way.
|
||||
|
||||
=item pt-online-schema-change
|
||||
|
||||
Perform online, non-blocking table schema changes.
|
||||
|
||||
=item pt-pmp
|
||||
|
||||
Aggregate GDB stack traces for a selected program.
|
||||
|
||||
=item pt-profile-compact
|
||||
|
||||
Compact the output from pt-query-profiler.
|
||||
|
||||
=item pt-query-advisor
|
||||
|
||||
Analyze queries and advise on possible problems.
|
||||
|
||||
=item pt-query-digest
|
||||
|
||||
Analyze query execution logs and generate a query report, filter, replay, or transform queries for MySQL, PostgreSQL, memcached, and more.
|
||||
|
||||
=item pt-query-profiler
|
||||
|
||||
Execute SQL statements and print statistics, or measure activity caused by other processes.
|
||||
|
||||
=item pt-rel
|
||||
|
||||
Make each number in a line of text relative to the previous matching line.
|
||||
|
||||
=item pt-show-grants
|
||||
|
||||
Canonicalize and print MySQL grants so you can effectively replicate, compare and version-control them.
|
||||
|
||||
=item pt-sift
|
||||
|
||||
Browses the files created by the collect tool.
|
||||
|
||||
=item pt-slave-delay
|
||||
|
||||
Make a MySQL slave server lag behind its master.
|
||||
|
||||
=item pt-slave-find
|
||||
|
||||
Find and print replication hierarchy tree of MySQL slaves.
|
||||
|
||||
=item pt-slave-restart
|
||||
|
||||
Watch and restart MySQL replication after errors.
|
||||
|
||||
=item pt-stalk
|
||||
|
||||
Watch MySQL and run the 'collect' program when some condition becomes true.
|
||||
|
||||
=item pt-summary
|
||||
|
||||
Summarize system information in a nice way.
|
||||
|
||||
=item pt-table-checksum
|
||||
|
||||
Perform an online replication consistency check, or checksum MySQL tables efficiently on one or many servers.
|
||||
|
||||
=item pt-table-sync
|
||||
|
||||
Synchronize MySQL table data efficiently.
|
||||
|
||||
=item pt-tcp-model
|
||||
|
||||
Transform tcpdump into metrics that permit performance and scalability modeling.
|
||||
|
||||
=item pt-trend
|
||||
|
||||
Compute statistics over a set of time-series data points.
|
||||
|
||||
=item pt-upgrade
|
||||
|
||||
Execute queries on multiple servers and check for differences.
|
||||
|
||||
=item pt-usl
|
||||
|
||||
Model Universal Scalability Law.
|
||||
|
||||
=item pt-variable-advisor
|
||||
|
||||
Analyze MySQL variables and advise on possible problems.
|
||||
|
||||
=item pt-visual-explain
|
||||
|
||||
Format EXPLAIN output as a tree.
|
||||
|
||||
=back
|
||||
|
||||
For more free, open-source software developed Percona, visit
|
||||
L<http://www.percona.com/software/>.
|
||||
L<http://www.percona.com/software/>.
|
||||
|
||||
=head1 CONFIGURATION FILES
|
||||
|
||||
@@ -162,7 +314,7 @@ tools support at least the following:
|
||||
|
||||
=over
|
||||
|
||||
=item * A
|
||||
=item A
|
||||
|
||||
Specifies the default character set for the connection.
|
||||
|
||||
@@ -178,11 +330,11 @@ library's settings don't match, there could be problems. You can use the
|
||||
defaults file to specify the client library's character set, however. See the
|
||||
description of the F part below.
|
||||
|
||||
=item * D
|
||||
=item D
|
||||
|
||||
Specifies the connection's default database.
|
||||
|
||||
=item * F
|
||||
=item F
|
||||
|
||||
Specifies a defaults file the mysql client library (the C client library used by
|
||||
DBD::mysql, I<not Percona Toolkit itself>) should read. The tools all read the
|
||||
@@ -205,26 +357,27 @@ L<"A"> part described above, this will actually instruct the client library
|
||||
(DBD::mysql) to change the character set it uses internally, which cannot be
|
||||
accomplished any other way as far as I know, except for C<utf8>.
|
||||
|
||||
=item * P
|
||||
=item h
|
||||
|
||||
Hostname or IP address for the connection.
|
||||
|
||||
=item p
|
||||
|
||||
Password to use when connecting.
|
||||
|
||||
|
||||
=item P
|
||||
|
||||
Port number to use for the connection. Note that the usual special-case
|
||||
behaviors apply: if you specify C<localhost> as your hostname on Unix systems,
|
||||
the connection actually uses a socket file, not a TCP/IP connection, and thus
|
||||
ignores the port.
|
||||
|
||||
=item * S
|
||||
=item S
|
||||
|
||||
Socket file to use for the connection (on Unix systems).
|
||||
|
||||
=item * h
|
||||
|
||||
Hostname or IP address for the connection.
|
||||
|
||||
=item * p
|
||||
|
||||
Password to use when connecting.
|
||||
|
||||
=item * u
|
||||
=item u
|
||||
|
||||
User for login if not current user.
|
||||
|
||||
|
@@ -42,6 +42,12 @@ DEB=$BRANCH/config/deb
|
||||
RPM=$BRANCH/config/rpm
|
||||
RELEASE=$BRANCH/release
|
||||
|
||||
# ############################################################################
|
||||
# Programs and their options
|
||||
# ############################################################################
|
||||
|
||||
TAR=${TAR:-tar}
|
||||
|
||||
# ############################################################################
|
||||
# Subroutines
|
||||
# ############################################################################
|
||||
@@ -138,7 +144,8 @@ make_manifest() {
|
||||
echo $file >> MANIFEST
|
||||
fi
|
||||
done
|
||||
find bin/pt-* >> MANIFEST
|
||||
find bin -type f -depth 1 >> MANIFEST
|
||||
find docs -type f -depth 1 >> MANIFEST
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
@@ -146,16 +153,68 @@ update_percona_toolkit_pod() {
|
||||
cd $BRANCH/bin
|
||||
|
||||
local pod=$DOCS/percona-toolkit.pod
|
||||
local tool_list=/tmp/percona-tool-list.pod
|
||||
|
||||
echo -n "Updating TOOLS section in percona-toolkit.pod: "
|
||||
|
||||
echo "=head1 TOOLS
|
||||
|
||||
This release of Percona Toolkit includes the following tools:
|
||||
|
||||
=over
|
||||
" > $tool_list
|
||||
|
||||
for tool in *; do
|
||||
desc=$(grep -A 2 '^=head1 NAME' $tool | tail -n 1 | sed 's/ - /:/' | cut -d':' -f2)
|
||||
echo "=item $tool
|
||||
|
||||
$desc
|
||||
"
|
||||
" >> $tool_list
|
||||
done
|
||||
|
||||
echo "=over" >> $pod
|
||||
echo "=back
|
||||
|
||||
For more free, open-source software developed Percona, visit
|
||||
L<http://www.percona.com/software/>.
|
||||
" >> $tool_list
|
||||
|
||||
cat $pod | ../util/replace-text -v from='^=head1 TOOLS' -v file=$tool_list -v to='^=head1' > $pod.tmp
|
||||
rm $tool_list
|
||||
|
||||
if [ -z "$(podchecker $pod.tmp 2>&1 | grep -i 'pod syntax OK')" ]; then
|
||||
die "POD syntax errors; run podchecker $pod.tmp"
|
||||
fi
|
||||
|
||||
mv $pod.tmp $pod
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
build_tar() {
|
||||
cd $BRANCH
|
||||
|
||||
local pkg="percona-toolkit-$VERSION"
|
||||
local pkg_dir="$RELEASE/$pkg"
|
||||
|
||||
echo -n "Building $pkg.tar.gz: "
|
||||
|
||||
if [ ! -d $RELEASE ]; then
|
||||
mkdir $RELEASE
|
||||
else
|
||||
rm -rf $RELEASE/*
|
||||
fi
|
||||
|
||||
|
||||
mkdir $pkg_dir
|
||||
mkdir "$pkg_dir/bin" "$pkg_dir/docs" "$pkg_dir/lib"
|
||||
|
||||
for file in `cat MANIFEST`; do
|
||||
cp $file $pkg_dir/$file
|
||||
done
|
||||
|
||||
cd $RELEASE
|
||||
$TAR czf "$pkg.tar.gz" $pkg
|
||||
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
# ############################################################################
|
||||
@@ -170,14 +229,17 @@ fi
|
||||
|
||||
DATE=$(date -u +'%F')
|
||||
VERSION=$1
|
||||
# check_version
|
||||
# update_version
|
||||
#check_version
|
||||
#update_version
|
||||
|
||||
YEAR=$(date -u +'%Y');
|
||||
#update_copyright_year
|
||||
|
||||
#make_manifest
|
||||
|
||||
update_percona_toolkit_pod
|
||||
#update_percona_toolkit_pod
|
||||
|
||||
build_tar
|
||||
|
||||
|
||||
exit $exit_status
|
||||
|
19
util/replace-text
Executable file
19
util/replace-text
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env awk -f
|
||||
|
||||
BEGIN {
|
||||
if ( from == "" || file == "" || to == "" ) {
|
||||
print "Usage: replace-text FROM_PATTERN TEXT_FILE TO_PATTERN"
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
$0 ~ from {
|
||||
system("cat " file)
|
||||
|
||||
while ( getline ) {
|
||||
if ( $0 ~ to )
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
{ print }
|
Reference in New Issue
Block a user