diff --git a/t/03-proxy_wasm/hfuncs/metrics/001-define_metric.t b/t/03-proxy_wasm/hfuncs/metrics/001-define_metric.t index b11f39d4a..44ae0aa54 100644 --- a/t/03-proxy_wasm/hfuncs/metrics/001-define_metric.t +++ b/t/03-proxy_wasm/hfuncs/metrics/001-define_metric.t @@ -16,21 +16,61 @@ run_tests(); __DATA__ -=== TEST 1: proxy_wasm - define_metric() sanity +=== TEST 1: proxy_wasm - define_metric() counter --- valgrind --- wasm_modules: hostcalls --- load_nginx_modules: ngx_http_echo_module --- config location /t { proxy_wasm hostcalls 'on_configure=define_metrics \ - metrics=c1,g1,h1'; + metrics=c1'; + echo ok; + } +--- grep_error_log eval: qr/\["hostcalls" \#\d\] defined metric \w+ as \d+/ +--- grep_error_log_out eval +qr/.*? defined metric c1 as \d+/ +--- no_error_log +[error] +[crit] +[emerg] +[alert] + + + +=== TEST 2: proxy_wasm - define_metric() gauge +--- valgrind +--- wasm_modules: hostcalls +--- load_nginx_modules: ngx_http_echo_module +--- config + location /t { + proxy_wasm hostcalls 'on_configure=define_metrics \ + metrics=g1'; + echo ok; + } +--- grep_error_log eval: qr/\["hostcalls" \#\d\] defined metric \w+ as \d+/ +--- grep_error_log_out eval +qr/.*? defined metric g1 as \d+/ +--- no_error_log +[error] +[crit] +[emerg] +[alert] + + + +=== TEST 3: proxy_wasm - define_metric() histogram +--- valgrind +--- wasm_modules: hostcalls +--- load_nginx_modules: ngx_http_echo_module +--- config + location /t { + proxy_wasm hostcalls 'on_configure=define_metrics \ + metrics=h1'; echo ok; } --- grep_error_log eval: qr/\["hostcalls" \#\d\] defined metric \w+ as \d+/ --- grep_error_log_out eval -qr/.*? defined metric c1 as \d+ -.*? defined metric g1 as \d+ -.*? defined metric h1 as \d+/ +qr/.*? defined metric h1 as \d+/ --- no_error_log [error] [crit] @@ -39,7 +79,7 @@ qr/.*? defined metric c1 as \d+ -=== TEST 2: proxy_wasm - define_metric() redefinition +=== TEST 4: proxy_wasm - define_metric() redefinition Definition happens only once, a second call defining an existing metric simply returns its id.