You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/13 10:38:26 UTC

[GitHub] [apisix] gy09535 commented on a change in pull request #2727: feat: Improve zipkin span reporter performance

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



##########
File path: apisix/plugins/zipkin/reporter.lua
##########
@@ -105,38 +104,68 @@ function _M.report(self, span)
         annotations = span.logs
     }
 
-    local i = self.pending_spans_n + 1
-    self.pending_spans[i] = zipkin_span
-    self.pending_spans_n = i
-end
-
-function _M.flush(self)
-    if self.pending_spans_n == 0 then
-
-        return true
+    self.pending_spans_n = self.pending_spans_n + 1
+    if self.processor then
+        self.processor:push(zipkin_span)
     end
+end
 
-    local pending_spans = cjson.encode(self.pending_spans)
-    self.pending_spans = {}
-    self.pending_spans_n = 0
-
+local function send_span(pending_spans, report)
     local httpc = resty_http.new()
-    local res, err = httpc:request_uri(self.endpoint, {

Review comment:
       for test case, I will change it .




----------------------------------------------------------------
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:
users@infra.apache.org