Skip to content

Commit b24bfac

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Track db sync command time useage"
2 parents a4c21ff + 633dbc3 commit b24bfac

7 files changed

Lines changed: 14 additions & 0 deletions

File tree

lib/cinder

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,10 @@ function init_cinder {
407407
# (Re)create cinder database
408408
recreate_database cinder
409409

410+
time_start "dbsync"
410411
# Migrate cinder database
411412
$CINDER_BIN_DIR/cinder-manage --config-file $CINDER_CONF db sync
413+
time_stop "dbsync"
412414
fi
413415

414416
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then

lib/glance

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,13 @@ function init_glance {
285285
# (Re)create glance database
286286
recreate_database glance
287287

288+
time_start "dbsync"
288289
# Migrate glance database
289290
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
290291

291292
# Load metadata definitions
292293
$GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
294+
time_stop "dbsync"
293295

294296
create_glance_cache_dir
295297
}

lib/keystone

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,10 @@ function init_keystone {
465465
recreate_database keystone
466466
fi
467467

468+
time_start "dbsync"
468469
# Initialize keystone database
469470
$KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF db_sync
471+
time_stop "dbsync"
470472

471473
if [[ "$KEYSTONE_TOKEN_FORMAT" == "pki" || "$KEYSTONE_TOKEN_FORMAT" == "pkiz" ]]; then
472474
# Set up certificates

lib/neutron

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,10 @@ function init_neutron_new {
336336

337337
recreate_database neutron
338338

339+
time_start "dbsync"
339340
# Run Neutron db migrations
340341
$NEUTRON_BIN_DIR/neutron-db-manage upgrade heads
342+
time_stop "dbsync"
341343

342344
create_neutron_cache_dir
343345
}

lib/neutron-legacy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,10 @@ function create_mutnauq_accounts {
417417
# init_mutnauq() - Initialize databases, etc.
418418
function init_mutnauq {
419419
recreate_database $Q_DB_NAME
420+
time_start "dbsync"
420421
# Run Neutron db migrations
421422
$NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head
423+
time_stop "dbsync"
422424
}
423425

424426
# install_mutnauq() - Collect source and prepare

lib/nova

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,9 @@ function init_nova_cells {
649649
iniset $NOVA_CELLS_CONF DEFAULT enabled_apis metadata
650650
fi
651651

652+
time_start "dbsync"
652653
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CELLS_CONF db sync
654+
time_stop "dbsync"
653655
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CELLS_CONF cell create --name=region --cell_type=parent --username=$RABBIT_USERID --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=/ --woffset=0 --wscale=1
654656
$NOVA_BIN_DIR/nova-manage cell create --name=child --cell_type=child --username=$RABBIT_USERID --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=child_cell --woffset=0 --wscale=1
655657

lib/placement

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ function create_placement_accounts {
149149
function init_placement {
150150
if [ "$PLACEMENT_DB_ENABLED" != False ]; then
151151
recreate_database placement
152+
time_start "dbsync"
152153
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
154+
time_stop "dbsync"
153155
fi
154156
create_placement_accounts
155157
}

0 commit comments

Comments
 (0)