|
96 | 96 | {nst_dets_file, undefined, "load-qst", string, "load quic session tickets from dets file"}, |
97 | 97 | %% == MQTT layer == |
98 | 98 | {username, $u, "username", string, |
99 | | - "username for connecting to server, support %i, %(i/2), %(rand(100)) variables"}, |
| 99 | + "username for connecting to server, support %i, %(rand(100)) variables"}, |
100 | 100 | {password, $P, "password", string, |
101 | 101 | "password for connecting to server"}, |
102 | 102 | {keepalive, $k, "keepalive", {integer, 300}, |
|
198 | 198 |
|
199 | 199 | -define(CONN_OPTS, ?COMMON_OPTS). |
200 | 200 |
|
| 201 | +-define(COUNTER_NAMES, |
| 202 | + [ publish_latency |
| 203 | + , recv |
| 204 | + , sub |
| 205 | + , sub_fail |
| 206 | + , pub |
| 207 | + , pub_fail |
| 208 | + , pub_overrun |
| 209 | + , pub_succ |
| 210 | + , connect_succ |
| 211 | + , connect_fail |
| 212 | + , connect_retried |
| 213 | + , reconnect_succ |
| 214 | + , unreachable |
| 215 | + , connection_refused |
| 216 | + , connection_timeout |
| 217 | + , connection_idle |
| 218 | + ]). |
| 219 | + |
201 | 220 | -define(shared_padding_tab, emqtt_bench_shared_payload). |
202 | 221 | -define(QoELog, qoe_dlog). |
203 | 222 | -define(cnt_map, cnt_map). |
@@ -966,18 +985,18 @@ eval_expr("rand(" ++ Str) -> |
966 | 985 | Int = strip_last_char(Str), |
967 | 986 | rand:uniform(list_to_integer(Int)); |
968 | 987 | _ -> Str |
969 | | - end. |
| 988 | + end; |
| 989 | +eval_expr(Str) -> |
| 990 | + throw({unsupported_expression, Str}). |
970 | 991 |
|
971 | 992 | parse_expr("%i") -> |
972 | 993 | erlang:get(conn_id); |
973 | | -parse_expr("%(i-div-2)") -> |
974 | | - erlang:get(conn_id) div 2; |
975 | | -parse_expr("%(" ++ Str) -> |
| 994 | +parse_expr("%(" ++ Str = Str0) -> |
976 | 995 | case lists:last(Str) of |
977 | 996 | $) -> |
978 | 997 | eval_expr(strip_last_char(Str)); |
979 | 998 | _ -> |
980 | | - throw({invalid_expression, "%(" ++ Str}) |
| 999 | + Str0 |
981 | 1000 | end; |
982 | 1001 | parse_expr(Str) -> |
983 | 1002 | Str. |
|
0 commit comments