gy09535 commented on a change in pull request #3070:
URL: https://github.com/apache/apisix/pull/3070#discussion_r548366235



##########
File path: t/plugin/prometheus.t
##########
@@ -1088,3 +1088,207 @@ GET /apisix/prometheus/metrics
 --- error_code: 200
 --- no_error_log
 [error]
+
+
+
+=== TEST 62: set batch plugins
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/9',
+                 ngx.HTTP_PUT,
+                 [[{
+                        "methods": ["GET"],
+                        "plugins": {
+                            "prometheus": {},
+                            "syslog": {
+                                           "host": "127.0.0.1",
+                                           "include_req_body": false,
+                                           "max_retry_times": 1,
+                                           "tls": false,
+                                           "retry_interval": 1,
+                                           "batch_max_size": 1000,
+                                           "buffer_duration": 60,
+                                           "port": 0,
+                                           "name": "sys-logger",
+                                           "flush_limit": 4096,
+                                           "sock_type": "tcp",
+                                           "timeout": 3,
+                                           "drop_limit": 1048576,
+                                           "pool_size": 5
+                                   },
+                            "zipkin": {
+                                "endpoint": "http://127.0.0.1:9447";,
+                                "service_name": "APISIX",
+                                "sample_ratio": 1
+                            },
+                            "http-logger": {
+                                "inactive_timeout": 5,
+                                "include_req_body": false,
+                                "timeout": 3,
+                                "name": "http-logger",
+                                "retry_delay": 1,
+                                "buffer_duration": 60,
+                                "uri": "http://127.0.0.1:19080/report";,
+                                "concat_method": "json",
+                                "batch_max_size": 1000,
+                                "max_retry_count": 0
+                            }                          
+                        },
+                        "upstream": {
+                            "nodes": {
+                                "127.0.0.1:1980": 1
+                            },
+                            "type": "roundrobin"
+                        },
+                        "uris": ["/batch-process-metrics"]
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 63: hit batch-process-metrics
+--- request
+GET /batch-process-metrics
+--- error_code: 404
+
+
+
+=== TEST 64: check sys logger metrics
+--- request
+GET /apisix/prometheus/metrics
+--- error_code: 200
+--- response_body_like eval
+qr/apisix_batch_process_entries{name="sys-logger",route_id="9"/

Review comment:
       plugin set error 😄




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to