tzssangglass commented on code in PR #7412:
URL: https://github.com/apache/apisix/pull/7412#discussion_r921761958
##########
t/plugin/prometheus.t:
##########
@@ -632,3 +632,53 @@ GET /apisix/prometheus/metrics
qr/apisix_/
--- response_body_unlike eval
qr/etcd/
+
+
+
+=== TEST 42: fetch the prometheus one shared dict data storage with string
+--- yaml_config
+nginx_config:
+ http:
+ lua_shared_dict:
+ internal-status: 10m
+--- request
+GET /apisix/prometheus/metrics
+--- response_body_like eval
+qr/.*apisix_shared_dict_capacity_bytes{name="internal-status"} \d+(?:.|\n)*
+apisix_shared_dict_free_space_bytes{name="internal-status"} \d+.*/
+
+
+
+=== TEST 43: fetch the prometheus multiple shared dict data
+--- yaml_config
+nginx_config:
+ http:
+ lua_shared_dict:
+ worker-events: 10m
+ upstream-healthcheck: 10m
+ internal-status: 10m
+--- request eval
+["GET /apisix/prometheus/metrics", "GET /apisix/prometheus/metrics", "GET
/apisix/prometheus/metrics"]
+--- response_body_like eval
+[qr/.*apisix_shared_dict_capacity_bytes{name="worker-events"} \d+(?:.|\n)*
+apisix_shared_dict_free_space_bytes{name="worker-events"} \d+.*/,
+qr/.*apisix_shared_dict_capacity_bytes{name="upstream-healthcheck"}
\d+(?:.|\n)*
+apisix_shared_dict_free_space_bytes{name="upstream-healthcheck"} \d+.*/,
+qr/.*apisix_shared_dict_capacity_bytes{name="internal-status"} \d+(?:.|\n)*
+apisix_shared_dict_free_space_bytes{name="internal-status"} \d+.*/]
+
+
+
+=== TEST 44: fetch the prometheus multiple shared dict data contain not exist
shared dict
+--- yaml_config
Review Comment:
> 1. The final result of `ngx_tpl.lua` depends on the configuration of
`yaml`, I don't understand what you mean, and all of your test cases are
written like this:
Not exactly true, we have some `lua_shared_dict` defined directly in
`ngx_tpl.lua` which does not appear in `config-default.yaml`, like `xds-config`
`xds-config-version`, but maybe we can optimize it later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]