一個簡單而強大的負載生成器:ponos
Ponos是一個簡單但功能強大的Erlang應用,用于生成頻率可配置的負載。它的設計是輕量級的,簡單的使用,并要求最低配置。
Quick Start Guide
$> git clone https://github.com/klarna/ponos.git
$> cd ponos
$> make
$> erl -pa ebin -s ponos
1> Args = [ {name, unique_name_of_type_atom}
1> , {task, fun() -> ok end}
1> , {load_spec, ponos_load_specs:make_constant(10.0)}
1> ].
2> ponos:add_load_generators([Args]).
3> ponos:init_load_generators().
4> application:stop(ponos).
負載生成器Load Generators
一個負載生成器只有三個部分:
Name
- A unique identifier (of type
atom()
) used to reference the load generator.
- A unique identifier (of type
Task
- A callback function of arity 0; the work to be performed in accordance with
LoadSpec
.
- A callback function of arity 0; the work to be performed in accordance with
LoadSpec
- The load specification defines the characteristic of the load. It is a function that maps time to intensity:
fun(T) -> I
whereT
is passed time in milliseconds andI
is the intensity expressed as calls per second. The user may define its own specification, but ponos provides typical load patterns such as constant load, bursts, staircase, and sawtooth. Seeponos_load_specs
for a full list of load specifications.
- The load specification defines the characteristic of the load. It is a function that maps time to intensity:
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!