Commit 00e4a569 authored by Francis Dupont's avatar Francis Dupont

[#1196] Renamed new command

parent 0d5c4cc4
1771. [func] fdupont
Added a stats-recount command to kea-admin tool, which recounts
cached statistics in MySQL and PostgreSQL lease databases.
1770. [func] fdupont
Added kea-admin lease-stat-recount command which recounts cached
statistics in MySQL and PostgreSQL lease databases.
......
......@@ -50,7 +50,7 @@ Arguments
to be used as a diagnostic tool, so it provides a portable,
human-readable form of the lease data.
**lease-stat-recount**
**stats-recount**
Recounts lease statistics for MySQL or PostgreSQL database.
``backend``
......
......@@ -60,7 +60,7 @@ usage() {
printf " - for checking databaseB version when preparing for an upgrade.\n"
printf " - db-upgrade: Upgrades your database scheme\n"
printf " - lease-dump: Dumps current leases to a CSV file\n"
printf " - lease-stat-recount: Recounts lease statistics\n"
printf " - stats-recount: Recounts lease statistics\n"
printf "\n"
printf "BACKEND - one of the supported backends: memfile|mysql|pgsql|cql\n"
printf "\n"
......@@ -681,7 +681,7 @@ if test "${command}" = "-v" || test "${command}" = "--version" ; then
exit 0
fi
is_in_list "${command}" "db-init db-version db-upgrade lease-dump lease-stat-recount"
is_in_list "${command}" "db-init db-version db-upgrade lease-dump stats-recount"
if [ ${_inlist} -eq 0 ]; then
log_error "invalid command: ${command}"
usage
......@@ -860,7 +860,7 @@ case ${command} in
;;
esac
;;
lease-stat-recount)
stats-recount)
case ${backend} in
memfile)
log_info "memfile does not keep lease statistics"
......
......@@ -54,7 +54,7 @@ OPTIONS
meant to be used as a diagnostic tool, so it provides a portable,
human-readable form of the lease data.
lease-stat-recount
stats-recount
Recounts lease statistics for MySQL or PostgreSQL database.
``backend``
......
......@@ -1194,10 +1194,10 @@ mysql_lease_stat_recount_test() {
run_statement "change v6 stats" "$qry"
# Recount all statistics from scratch.
${keaadmin} lease-stat-recount mysql -u $db_user -p $db_password -n $db_name
${keaadmin} stats-recount mysql -u $db_user -p $db_password -n $db_name
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-stat-recount mysql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin stats-recount mysql returned non-zero status code %d, expected %d"
#
# First we'll verify lease4_stats are correct after recount.
......
......@@ -835,10 +835,10 @@ pgsql_lease_stat_recount_test() {
run_statement "change v6 stats" "$qry"
# Recount all statistics from scratch.
${keaadmin} lease-stat-recount pgsql -u $db_user -p $db_password -n $db_name
${keaadmin} stats-recount pgsql -u $db_user -p $db_password -n $db_name
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-stat-recount pgsql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin stats-recount pgsql returned non-zero status code %d, expected %d"
#
# First we'll verify lease4_stats are correct after recount.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment