@achannarasappa/locust-cli 中文文档教程

发布于 5年前 浏览 20 更新于 3年前

Locust CLI

用于加速 Locust 作业开发的开发人员工具

Quick Start

npm install @achannarasappa/locust-cli
❯ locust
locust <command>

Commands:
  locust run       run in single job mode
  locust start     starts a job and crawls until a stop condition is met
  locust stop      Stop running jobs and stop redis and browserless containers
  locust generate  generate a job definition through a series of prompts
  locust validate  validate a job definition
  locust info      information on queue state and jobs in each status

Options:
  -v, --version  Show version number                                   [boolean]
  -h, --help     Show help                                             [boolean]

Features

Generate a job definition file

通过回答一组提示,使用 locust generate 交互式生成作业定义文件。

Test CSS selectors and data extraction logic

使用 locust run 运行作业会向入口点 url 发出请求并运行 extract 挂钩,这是一种测试定义的 CSS 选择器和其他数据提取逻辑是否有效的轻量级方法正如预期的那样。

Start a job locally before pushing to a cloud provider

模拟和调试在云提供商上运行的作业,无需推送代码或配置基础设施。 locust start 将像在云提供商上一样运行作业,并提供一个仪表板以帮助了解作业正在做什么并识别潜在的问题区域。

Reference

Locust CLI

Developer tools to accelerate development of Locust jobs

Quick Start

npm install @achannarasappa/locust-cli
❯ locust
locust <command>

Commands:
  locust run       run in single job mode
  locust start     starts a job and crawls until a stop condition is met
  locust stop      Stop running jobs and stop redis and browserless containers
  locust generate  generate a job definition through a series of prompts
  locust validate  validate a job definition
  locust info      information on queue state and jobs in each status

Options:
  -v, --version  Show version number                                   [boolean]
  -h, --help     Show help                                             [boolean]

Features

Generate a job definition file

Interactively generate a job definition file with locust generate by answering a set of prompts.

Test CSS selectors and data extraction logic

Running a job with locust run makes a request to the entrypoint url and runs the extract hook which is a lightweight way to test that the defined CSS selectors and other data extraction logic works as expected.

Start a job locally before pushing to a cloud provider

Simulate and debug a job run on a cloud provider without pushing up code or provisioning infrastructure. locust start will run a job as it would on a cloud provider and presents a dashboard to help understand what the job is doing and identify potential problem areas.

Reference

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文