From 43a520c1e93ace7295d1f28b4930a44378bcc7a9 Mon Sep 17 00:00:00 2001 From: Andy Ning Date: Fri, 19 Jul 2024 14:19:07 -0400 Subject: [PATCH] Add logs to horizon startup script to time actions Added logging instructions to horizon startup script to measure time SM actions (status, start, stop) take. Test Plan: PASS: AIO-DX installation, after installation, verify time for SM actions are logged in /var/log/horizon_sm.log Story: 2010940 Task: 50623 Change-Id: I8f5e486bbc8a58776b2c50de060fd46690945992 Signed-off-by: Andy Ning --- openstack/python-horizon/files/horizon.init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openstack/python-horizon/files/horizon.init b/openstack/python-horizon/files/horizon.init index 2b8e4fd7..a5f69587 100755 --- a/openstack/python-horizon/files/horizon.init +++ b/openstack/python-horizon/files/horizon.init @@ -132,6 +132,8 @@ status() RETVAL=3 } +start=$(date +%s%N) +echo "$(date '+%Y-%m-%dT%H:%M:%S:%3N'): action:${1}:start-at:${start: 0:-6} ms" >> /var/log/horizon_sm.log case "$1" in start) start @@ -151,5 +153,9 @@ case "$1" in RETVAL=1 ;; esac +end=$(date +%s%N) +echo "$(date '+%Y-%m-%dT%H:%M:%S:%3N'): action:${1}:end-at:${end: 0:-6} ms" >> /var/log/horizon_sm.log +diff=$((end-start)) +echo "$(date '+%Y-%m-%dT%H:%M:%S:%3N'): action:${1}:took:${diff: 0:-6} ms" >> /var/log/horizon_sm.log exit $RETVAL