Skip to main content

lkr

Usage:

$ lkr [OPTIONS] COMMAND [ARGS]...

Options:

  • --no-gevent-patch: Disable gevent monkey patching
  • --json-log: Enable JSON logging
  • --env-file FILE: Path to the environment file to load [default: /usr/local/google/home/bryanweber/lkrdev/load-test/.env]
  • --client-id TEXT: Looker API client ID
  • --client-secret TEXT: Looker API client secret
  • --base-url TEXT: Looker API base URL
  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • load-test

lkr load-test

Usage:

$ lkr load-test [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • debug: Check that the environment variables are...
  • cookieless-embed-dashboard: Run a load test on a dashboard using...
  • dashboard: Run a load test on a dashboard using...
  • query: Run a load test by executing specific...
  • dashboard-queries: Run queries from specified dashboards with...
  • render: Run a load test by requesting renders...
  • embed-observability: Open dashboards with observability metrics.
  • delete-embed-users: Remove all embed users for a dashboard

lkr load-test debug

Check that the environment variables are set correctly

Usage:

$ lkr load-test debug [OPTIONS] TYPE:{looker}

Arguments:

  • TYPE:{looker}: Type of debug to run (looker) [required]

Options:

  • --help: Show this message and exit.

lkr load-test cookieless-embed-dashboard

Run a load test on a dashboard using Cookieless Embed V2.

Usage:

$ lkr load-test cookieless-embed-dashboard [OPTIONS]

Options:

  • --dashboard TEXT: Dashboard ID to run the test on. Keeps dashboard open for user, turn on auto-refresh to keep dashboard updated [required]
  • --model TEXT: Model to run the test on. Specify multiple models as --model model1 --model model2 [required]
  • --attribute TEXT: Looker attributes to run the test on. Specify them as attribute:value like --attribute store:value. Excepts multiple arguments --attribute store:acme --attribute team:managers. Accepts random.randint(0,1000) format
  • --group TEXT: Looker group IDs to add to the user. Useful when you have a closed system and need to test with content in a shared folder. Accepts multiple arguments --group 123 --group 456
  • --external-group-id TEXT: External group ID to add to the user. Will be prefixed with embed unless overridden with --external-group-id-prefix
  • --external-group-id-prefix TEXT: Prefix to add to the group IDs. Defaults to embed. To remove the prefix, pass in an empty string [default: embed]
  • --users INTEGER RANGE: Number of users to run the test with [default: 25; 1<=x<=1000]
  • --spawn-rate FLOAT RANGE: Number of users to spawn per second [default: 1; 0<=x<=100]
  • --run-time INTEGER RANGE: How many minutes to run the load test for [default: 5; x>=1]
  • --stop-timeout INTEGER: How many seconds to wait for the load test to stop [default: 15]
  • --debug: Enable debug mode
  • --first-name TEXT: First name of the embed user [default: Embed]
  • --help: Show this message and exit.

lkr load-test dashboard

Run a load test on a dashboard using standard SSO embedding.

Usage:

$ lkr load-test dashboard [OPTIONS]

Options:

  • --dashboard TEXT: Dashboard ID to run the test on. Keeps dashboard open for user, turn on auto-refresh to keep dashboard updated [required]
  • --model TEXT: Model to run the test on. Specify multiple models as --model model1 --model model2 [required]
  • --group TEXT: Looker group IDs to add to the user. Useful when you have a closed system and need to test with content in a shared folder. Accepts multiple arguments --group 123 --group 456
  • --external-group-id TEXT: External group ID to add to the user. Will be prefixed with embed unless overridden with --external-group-id-prefix
  • --external-group-id-prefix TEXT: Prefix to add to the group IDs. Defaults to embed. To remove the prefix, pass in an empty string [default: embed]
  • --users INTEGER RANGE: Number of users to run the test with [default: 25; 1<=x<=1000]
  • --spawn-rate FLOAT RANGE: Number of users to spawn per second [default: 1; 0<=x<=100]
  • --run-time INTEGER RANGE: How many minutes to run the load test for [default: 5; x>=1]
  • --attribute TEXT: Looker attributes to run the test on. Specify them as attribute:value like --attribute store:value. Excepts multiple arguments --attribute store:acme --attribute team:managers. Accepts random.randint(0,1000) format
  • --stop-timeout INTEGER: How many seconds to wait for the load test to stop [default: 15]
  • --first-name TEXT: First name of the embed user [default: Embed]
  • --help: Show this message and exit.

lkr load-test query

Run a load test by executing specific queries by ID.

Usage:

$ lkr load-test query [OPTIONS]

Options:

  • --query TEXT: Query ID (from explore url) to run the test on [required]
  • --users INTEGER RANGE: Number of users to run the test with [default: 25; 1<=x<=1000]
  • --spawn-rate FLOAT RANGE: Number of users to spawn per second [default: 1; 0<=x<=100]
  • --run-time INTEGER RANGE: How many minutes to run the load test for [default: 5; x>=1]
  • --model TEXT: Model to run the test on. Specify multiple models as --model model1 --model model2
  • --attribute TEXT: Looker attributes to run the test on. Specify them as attribute:value like --attribute store:value. Accepts multiple arguments --attribute store:acme --attribute team:managers. Accepts random.randint(0,1000) format
  • --group TEXT: Looker group IDs to add to the user. Useful when you have a closed system and need to test with content in a shared folder. Accepts multiple arguments --group 123 --group 456
  • --external-group-id TEXT: External group ID to add to the user. Will be prefixed with embed unless overridden with --external-group-id-prefix
  • --external-group-id-prefix TEXT: Prefix to add to the group IDs. Defaults to embed. To remove the prefix, pass in an empty string [default: embed]
  • --wait-time-min INTEGER RANGE: User tasks have a random wait time between this and the max wait time [default: 1; 1<=x<=100]
  • --wait-time-max INTEGER RANGE: User tasks have a random wait time between this and the min wait time [default: 15; 1<=x<=100]
  • --sticky-sessions / --no-sticky-sessions: Keep the same user logged in for the duration of the test. sticky_sessions=True is currently not supported with the Looker SDKs, we are working around it in the User class. [default: no-sticky-sessions]
  • --query-async / --no-query-async: Run the query asynchronously [default: no-query-async]
  • --async-bail-out INTEGER: How many iterations to wait for the async query to complete (roughly number of seconds) [default: 120]
  • --first-name TEXT: First name of the embed user [default: Embed]
  • --help: Show this message and exit.

lkr load-test dashboard-queries

Run queries from specified dashboards with custom logging. This command allows you to test dashboard performance by executing the queries that power the dashboards.

Usage:

$ lkr load-test dashboard-queries [OPTIONS]

Options:

  • --dashboard TEXT: Dashboard ID to extract queries from [required]
  • --users INTEGER RANGE: Number of users to run the test with [default: 25; 1<=x<=1000]
  • --spawn-rate FLOAT RANGE: Number of users to spawn per second [default: 1; 0<=x<=100]
  • --run-time INTEGER RANGE: How many minutes to run the load test for [default: 5; x>=1]
  • --model TEXT: Model to run the test on. Specify multiple models as --model model1 --model model2
  • --attribute TEXT: Looker attributes to run the test on. Specify them as attribute:value like --attribute store:value. Accepts multiple arguments --attribute store:acme --attribute team:managers. Accepts random.randint(0,1000) format
  • --group TEXT: Looker group IDs to add to the user. Useful when you have a closed system and need to test with content in a shared folder. Accepts multiple arguments --group 123 --group 456
  • --external-group-id TEXT: External group ID to add to the user. Will be prefixed with embed unless overridden with --external-group-id-prefix
  • --external-group-id-prefix TEXT: Prefix to add to the group IDs. Defaults to embed. To remove the prefix, pass in an empty string [default: embed]
  • --wait-time-min INTEGER RANGE: User tasks have a random wait time between this and the max wait time [default: 1; 1<=x<=100]
  • --wait-time-max INTEGER RANGE: User tasks have a random wait time between this and the min wait time [default: 15; 1<=x<=100]
  • --sticky-sessions / --no-sticky-sessions: Keep the same user logged in for the duration of the test. [default: no-sticky-sessions]
  • --query-async / --no-query-async: Run the query asynchronously [default: no-query-async]
  • --async-bail-out INTEGER: How many iterations to wait for the async query to complete (roughly number of seconds) [default: 120]
  • --first-name TEXT: First name of the embed user [default: Embed]
  • --help: Show this message and exit.

lkr load-test render

Run a load test by requesting renders (PDF/PNG/JPG) of a dashboard.

Usage:

$ lkr load-test render [OPTIONS]

Options:

  • --dashboard TEXT: Dashboard ID to render [required]
  • --users INTEGER RANGE: Number of users to run the test with [default: 25; 1<=x<=1000]
  • --spawn-rate FLOAT RANGE: Number of users to spawn per second [default: 1; 0<=x<=100]
  • --run-time INTEGER RANGE: How many minutes to run the load test for [default: 5; x>=1]
  • --model TEXT: Model to run the test on. Specify multiple models as --model model1 --model model2
  • --group TEXT: Looker group IDs to add to the user. Useful when you have a closed system and need to test with content in a shared folder. Accepts multiple arguments --group 123 --group 456
  • --external-group-id TEXT: External group ID to add to the user. Will be prefixed with embed unless overridden with --external-group-id-prefix
  • --external-group-id-prefix TEXT: Prefix to add to the group IDs. Defaults to embed. To remove the prefix, pass in an empty string [default: embed]
  • --attribute TEXT: Looker attributes to run the test on. Specify them as attribute:value like --attribute store:value. Excepts multiple arguments --attribute store:acme --attribute team:managers. Accepts random.randint(0,1000) format
  • --result-format TEXT: Format of the rendered output (pdf, png, jpg) [default: pdf]
  • --render-bail-out INTEGER: How many iterations to wait for the render task to complete (roughly number of seconds) [default: 120]
  • --run-once / --no-run-once: Make each user run its render task only once. [default: no-run-once]
  • --first-name TEXT: First name of the embed user [default: Embed]
  • --help: Show this message and exit.

lkr load-test embed-observability

Open dashboards with observability metrics. The metrics are collected through Looker's JavaScript events and logged with the specified prefix. This command will:

  1. Start an embed server to host the dashboard iframe
  2. Spawn multiple users that will:
    • Open the dashboard in an iframe
    • Wait for the dashboard to load
    • Track timing metrics for:
      • dashboard:loaded - Dashboard load time
      • dashboard:run:start - Query start time
      • dashboard:run:complete - Query completion time
      • dashboard:tile:start - Individual tile start time
      • dashboard:tile:complete - Individual tile completion time
  3. Will also track start and end times for the whole process (looker_embed_task_start and looker_embed_task_complete)
  4. Log all events with timing information to help analyze performance in a JSON format. Events begin with <log_event_prefix>:*
  5. Automatically stop after the specified run time
  6. Optionally, if multiple are ID's are provided to dashboard then we'll monitor performance of tabbing between each report.

Usage:

$ lkr load-test embed-observability [OPTIONS]

Options:

  • --dashboard TEXT: Dashboard ID to render. Alternatively, provide a comma seperated list of dashboard ID's and we'll simulate navigating between dashboard tabs all within the iFrame and observe performance. [required]
  • --users INTEGER RANGE: Number of users to run the test with [default: 5; 1<=x<=1000]
  • --spawn-rate FLOAT RANGE: Number of users to spawn per second [default: 1; 0<=x<=100]
  • --run-time INTEGER RANGE: How many minutes to run the load test for [default: 5; x>=1]
  • --port INTEGER: Port to run the embed server on [default: 4000]
  • --min-wait INTEGER RANGE: Minimum wait time between tasks [default: 60; x>=1]
  • --max-wait INTEGER RANGE: Maximum wait time between tasks [default: 120; x>=1]
  • --model TEXT: Model to run the test on. Specify multiple models as --model model1 --model model2
  • --group TEXT: Looker group IDs to add to the user. Useful when you have a closed system and need to test with content in a shared folder. Accepts multiple arguments --group 123 --group 456
  • --external-group-id TEXT: External group ID to add to the user. Will be prefixed with embed unless overridden with --external-group-id-prefix
  • --external-group-id-prefix TEXT: Prefix to add to the group IDs. Defaults to embed. To remove the prefix, pass in an empty string [default: embed]
  • --completion-timeout INTEGER RANGE: Timeout in seconds for the dashboard run complete event [default: 120; x>=1]
  • --attribute TEXT: Looker attributes to run the test on. Specify them as attribute:value like --attribute store:value. Excepts multiple arguments --attribute store:acme --attribute team:managers. Accepts random.randint(0,1000) format
  • --log-event-prefix TEXT: Prefix to add to the log event [default: looker-embed-observability]
  • --open-url / --no-open-url: Do not open the URL in the observability browser, useful for viewing a user's embed dashboard when running locally [default: open-url]
  • --debug: Enable debug mode
  • --embed-as-me / --no-embed-as-me: An optional flag to generate the url as an existing embed user. This means no user sensitive info is encoded in the url. If selected the '--embed_user_id' flag is also required to login as a specific embed user. [default: no-embed-as-me]
  • --embed-user-id TEXT: An optional Embed User to generate the url for. Only used if '--embed_as_me' flag is selected
  • --first-name TEXT: First name of the embed user [default: Embed]
  • --help: Show this message and exit.

lkr load-test delete-embed-users

Remove all embed users for a dashboard

Usage:

$ lkr load-test delete-embed-users [OPTIONS]

Options:

  • --first-name TEXT: First name of the user to remove [default: Embed]
  • --dry-run / --no-dry-run: Do not delete the users, just print the users that would be deleted [default: dry-run]
  • --limit INTEGER: Limit the number of users to remove [default: 100]
  • --help: Show this message and exit.