From 265f6d930e45c6bfea6d0cfe46c35e0f84535681 Mon Sep 17 00:00:00 2001 From: Oscar Arribas Arribas Date: Wed, 17 Jul 2024 14:49:13 +0200 Subject: [PATCH] Collect etcd object count --- collection-scripts/gather_etcd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/collection-scripts/gather_etcd b/collection-scripts/gather_etcd index db23669a..4ed1b9a8 100755 --- a/collection-scripts/gather_etcd +++ b/collection-scripts/gather_etcd @@ -56,6 +56,11 @@ echo "INFO: Getting etcdctl alarm list" ocp4etcdctl alarm list -w json > ${ETCD_LOG_PATH}/alarm_list.json & PIDS+=($!) +# object count +echo "INFO: Getting object count" +ocp4etcdctl get / --prefix --keys-only | sed '/^$/d' | cut -d/ -f3 | sort | uniq -c | sort -rn | awk '{print $2 ":" $1}' | jq -nRc ' [inputs | index(":") as $ix | {(.[:$ix]): .[$ix+1:]}] | add' > ${ETCD_LOG_PATH}/object_count.json & +PIDS+=($!) + echo "INFO: Waiting for etcd info collection to complete ..." wait "${PIDS[@]}" echo "INFO: Done collecting etcd information"