ccxhwmy commented on code in PR #7412:
URL: https://github.com/apache/apisix/pull/7412#discussion_r922070884


##########
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:
   > > Here it can be verified that yaml_config is not sufficient condition.
   > 
   > We already have some lua_shared_dict defined in the yaml by default. Is it 
necessary to override the default yaml to verify it?
   
   I tested and found that APISIX will use `config-default.yaml` as the 
configuration when running the test case, my understanding was wrong.



-- 
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]

Reply via email to