Skip to content

Commit

Permalink
Collect etcd object count
Browse files Browse the repository at this point in the history
  • Loading branch information
oarribas authored Jul 17, 2024
1 parent 2d8ff6d commit 265f6d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions collection-scripts/gather_etcd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 265f6d9

Please sign in to comment.