1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00
kyverno/docs/perf-testing/size.sh
shuting 47bf1e8612
Add scaling testing instructions (#7295)
* add instructions

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add etcd sizes for pods

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add kwok script

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update kwok script

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update node creation script

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add script to calculate size

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* linter fixes

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-05-30 14:57:32 +00:00

24 lines
No EOL
689 B
Bash
Executable file

#!/bin/bash
## calculate total size for the given object
# read user input for the resource
echo "Enter the resource to caclutate the size:"
read resource
sum=0
for key in `etcdctl get --prefix --keys-only /registry/$resource`
do
size=`etcdctl get $key --print-value-only | wc -c`
count=`etcdctl get $key --write-out=fields | grep \"Count\" | cut -f2 -d':'`
if [ $count -ne 0 ]; then
versions=`etcdctl get $key --write-out=fields | grep \"Version\" | cut -f2 -d':'`
else
versions=0
fi
total=$(( $size * $versions))
sum=$(( $sum + $total ))
echo $sum $total $size $versions $count $key >> /tmp/etcdkeys.txt
done
echo "The total size for $resource is $sum bytes."