Monkey测试(压力测试)

显示原文

A simple monkey test. Use random input to stress test the application.


这里提供一个简单的 monkey 测试接口,其使用随机输入来对应用程序进行压力测试。

Usage(用法)

显示原文

Enable LV_USE_MONKEY in lv_conf.h.

First configure monkey, use lv_monkey_config_t to define the configuration structure, set the type (check Input Devices for the supported types), and then set the range of period_range and input_range, the monkey will output random operations at random times within this range. Call lv_monkey_create() to create monkey. Finally call lv_monkey_set_enable(monkey, true) to enable monkey.

If you want to pause the monkey, call lv_monkey_set_enable(monkey, false). To delete the monkey, call lv_monkey_delete(monkey).

Note that input_range has different meanings in different type:


lv_conf.h 中启用 LV_USE_MONKEY

首先配置 monkey,使用 lv_monkey_config_t 定义配置结构,设置 type``(查看 :ref:`Input Devices <indev>` 了解支持的类型),然后设置 ``period_rangeinput_range 的范围,monkey 将在该范围内随机时间输出随机操作。调用 lv_monkey_create() 创建 monkey。最后调用 lv_monkey_set_enable(monkey, true) 启用 monkey。

如果需要暂停 monkey,调用 lv_monkey_set_enable(monkey, false)。如需删除 monkey,调用 lv_monkey_delete(monkey)

需要注意的是,input_range 在不同 type 中的含义不同:

Example

Touchpad monkey example


Encoder monkey example


Button monkey example


API

lv_monkey.h

lv_types.h