mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
[#1196] Renamed new command
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
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
|
1770. [func] fdupont
|
||||||
Added kea-admin lease-stat-recount command which recounts cached
|
Added kea-admin lease-stat-recount command which recounts cached
|
||||||
statistics in MySQL and PostgreSQL lease databases.
|
statistics in MySQL and PostgreSQL lease databases.
|
||||||
|
@@ -50,7 +50,7 @@ Arguments
|
|||||||
to be used as a diagnostic tool, so it provides a portable,
|
to be used as a diagnostic tool, so it provides a portable,
|
||||||
human-readable form of the lease data.
|
human-readable form of the lease data.
|
||||||
|
|
||||||
**lease-stat-recount**
|
**stats-recount**
|
||||||
Recounts lease statistics for MySQL or PostgreSQL database.
|
Recounts lease statistics for MySQL or PostgreSQL database.
|
||||||
|
|
||||||
``backend``
|
``backend``
|
||||||
|
@@ -60,7 +60,7 @@ usage() {
|
|||||||
printf " - for checking databaseB version when preparing for an upgrade.\n"
|
printf " - for checking databaseB version when preparing for an upgrade.\n"
|
||||||
printf " - db-upgrade: Upgrades your database scheme\n"
|
printf " - db-upgrade: Upgrades your database scheme\n"
|
||||||
printf " - lease-dump: Dumps current leases to a CSV file\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 "\n"
|
||||||
printf "BACKEND - one of the supported backends: memfile|mysql|pgsql|cql\n"
|
printf "BACKEND - one of the supported backends: memfile|mysql|pgsql|cql\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
@@ -681,7 +681,7 @@ if test "${command}" = "-v" || test "${command}" = "--version" ; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
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
|
if [ ${_inlist} -eq 0 ]; then
|
||||||
log_error "invalid command: ${command}"
|
log_error "invalid command: ${command}"
|
||||||
usage
|
usage
|
||||||
@@ -860,7 +860,7 @@ case ${command} in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
lease-stat-recount)
|
stats-recount)
|
||||||
case ${backend} in
|
case ${backend} in
|
||||||
memfile)
|
memfile)
|
||||||
log_info "memfile does not keep lease statistics"
|
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,
|
meant to be used as a diagnostic tool, so it provides a portable,
|
||||||
human-readable form of the lease data.
|
human-readable form of the lease data.
|
||||||
|
|
||||||
lease-stat-recount
|
stats-recount
|
||||||
Recounts lease statistics for MySQL or PostgreSQL database.
|
Recounts lease statistics for MySQL or PostgreSQL database.
|
||||||
|
|
||||||
``backend``
|
``backend``
|
||||||
|
@@ -1194,10 +1194,10 @@ mysql_lease_stat_recount_test() {
|
|||||||
run_statement "change v6 stats" "$qry"
|
run_statement "change v6 stats" "$qry"
|
||||||
|
|
||||||
# Recount all statistics from scratch.
|
# 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=$?
|
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.
|
# 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"
|
run_statement "change v6 stats" "$qry"
|
||||||
|
|
||||||
# Recount all statistics from scratch.
|
# 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=$?
|
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.
|
# First we'll verify lease4_stats are correct after recount.
|
||||||
|
Reference in New Issue
Block a user