A CLI utility built using Typer, Locust, and the Looker Python SDK to execute load tests, collect embed observability metrics, and manage/cleanup Looker SSO embed users.
- Debug Diagnostics: Quickly test and verify your Looker API connection and SDK settings.
- Load Testing: Simulates concurrent users accessing dashboards, running queries, rendering PDFs/images, or loading cookieless embed environments.
- Observability Server: Hosts a local dashboard iframe server, launches automated users, tracks Looker iframe JS event timings (
loaded,run:start,run:complete), and reports performance metrics. - Embed User Cleanup: Batch deletes expired/old SSO embed users using concurrent thread pools to keep Looker instance user lists clean.
- Python 3.13 or higher
- uv (recommended Python package installer)
- Docker (optional, for containerization)
- Google Cloud SDK (
gcloud) (optional, if pushing to GCP Artifact Registry)
Clone/copy the repository, navigate to the folder, and run:
# Install runtime dependencies
make install
# Install dev dependencies (pytest, pre-commit, etc.)
make dev-installThe CLI relies on standard Looker SDK environment variables. Create a .env file in the root of the project:
LOOKERSDK_BASE_URL="https://your-looker-instance.com:19999"
LOOKERSDK_CLIENT_ID="your_api_client_id"
LOOKERSDK_CLIENT_SECRET="your_api_client_secret"Verify your configuration by running the debug check:
make run-debugThe main entry point is lkr.
# Debug credentials & check connectivity
uv run lkr load-test debug looker# Run a dashboard load test for 5 minutes with 25 users
uv run lkr load-test dashboard --dashboard <dashboard_id> --model <model_name> --users 25 --run-time 5uv run lkr load-test cookieless-embed-dashboard --dashboard <dashboard_id> --model <model_name> --users 25uv run lkr load-test query --query <query_id> --model <model_name> --users 25uv run lkr load-test render --dashboard <dashboard_id> --model <model_name> --result-format pdfStarts a local web server to capture Looker javascript frontend metrics during simulated dashboard sessions:
uv run lkr load-test embed-observability --dashboard <dashboard_id> --port 4000SSO embed logins create new users in Looker. Clean them up using concurrent batch deletion:
# Dry run to see how many users match the prefix (defaults to first name "Embed")
uv run lkr load-test delete-embed-users --first-name "Embed" --dry-run
# Execute deletion with a limit
uv run lkr load-test delete-embed-users --first-name "Embed" --no-dry-run --limit 500This tool is pre-packaged as a Docker image. You do not need to install Python or build any code to use it. You can run it effortlessly on a serverless Google Cloud Run Job by copying the command below:
- Update
--projectto your Google Cloud project. - Provide your Looker API Credentials in the
--set-env-varsflag. - Pass any script arguments into
--args.
gcloud run jobs create delete-embed-users-job \
--project=your-target-cloud-project \
--region=us-central1 \
--task-timeout=60 \
--max-retries=0 \
--execute-now \
--image=us-west1-docker.pkg.dev/looker-scale-testing/delete-embed-users-v2/delete-embed-users:latest \
--set-env-vars=LOOKERSDK_CLIENT_ID=YOUR_CLIENT_ID,LOOKERSDK_CLIENT_SECRET=YOUR_CLIENT_SECRET,LOOKERSDK_BASE_URL=https://yourinstance.cloud.looker.com \
--command="lkr" \
--args="delete-embed-users"Use the included Makefile for common development tasks:
make test- Run pytest suites.make format- Format code and run pre-commit checks.make clean- Remove virtualenv, caches, and build artifacts.