Skip to content

Instantly share code, notes, and snippets.

@vishnu2kmohan
Last active May 8, 2017 13:49
Show Gist options
  • Select an option

  • Save vishnu2kmohan/8daac02c00702c4a1909b67f24bb7807 to your computer and use it in GitHub Desktop.

Select an option

Save vishnu2kmohan/8daac02c00702c4a1909b67f24bb7807 to your computer and use it in GitHub Desktop.
Service Account Benchmark
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
private_key="service-account-bench-id_rsa"
public_key="service-account-bench-id_rsa.pub"
echo -n "Creating Service Account Keypair (4096 bit): "
(/usr/bin/time -f "real %e user %U sys %S" \
dcos security org service-accounts keypair \
-l 4096 \
"${private_key}" \
"${public_key}") 2>&1 | tr "\n" " "
echo
for i in `seq 1 5`
do
echo -n "Creating service-account-bench-${i}: "
(/usr/bin/time -f "real %e user %U sys %S" \
dcos security org service-accounts create \
-p "${public_key}" \
-d "Service Account Benchmark ${i}" \
"service-account-bench-${i}") 2>&1 | tr "\n" " "
echo
done
#echo "Sleeping for 3 seconds for Zookeeper to settle"
sleep 3
dcos security org service-accounts show | grep service-account-bench
for i in `seq 1 5`
do
echo -n "Deleting service-account-bench-${i}: "
(/usr/bin/time -f "real %e user %U sys %S" \
dcos security org service-accounts delete \
"service-account-bench-${i}") 2>&1 | tr "\n" " "
echo
done
#echo "Sleeping for 3 seconds for Zookeeper to settle"
sleep 3
dcos security org service-accounts show | grep service-account-bench
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment