You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/05/07 03:20:31 UTC

[incubator-apisix] branch master updated: doc: alter logger plugins documentations. (#1541)

This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new e8091f6  doc: alter logger plugins documentations. (#1541)
e8091f6 is described below

commit e8091f6e2ce39f9ea37d4abaa9ea9947a3108142
Author: Ayeshmantha Perera <ak...@apache.org>
AuthorDate: Thu May 7 05:20:23 2020 +0200

    doc: alter logger plugins documentations. (#1541)
---
 doc/batch-processor-cn.md      | 69 ++++++++++++++++++++++++++++++++++++++++++
 doc/plugins/kafka-logger-cn.md |  5 +++
 doc/plugins/kafka-logger.md    |  5 +++
 doc/plugins/tcp-logger-cn.md   |  5 +++
 doc/plugins/tcp-logger.md      |  5 +++
 doc/plugins/udp-logger-cn.md   |  5 +++
 doc/plugins/udp-logger.md      |  5 +++
 7 files changed, 99 insertions(+)

diff --git a/doc/batch-processor-cn.md b/doc/batch-processor-cn.md
new file mode 100644
index 0000000..92ecb77
--- /dev/null
+++ b/doc/batch-processor-cn.md
@@ -0,0 +1,69 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+[English](batch-processor.md)
+
+# 批处理机
+
+批处理处理器可用于聚合条目(日志/任何数据)并进行批处理。
+当batch_max_size设置为零时,处理器将立即执行每个条目。将批处理的最大大小设置为大于1将开始聚合条目,直到达到最大大小或超时到期为止
+
+## 构型
+
+创建批处理程序的唯一必需参数是函数。当批处理达到最大大小或缓冲区持续时间超过时,将执行该功能。
+
+|名称           |需求    |描述|
+|-------        |-----          |------|
+|id             |可选的       |标识批处理者的唯一标识符|
+|batch_max_size |可选的       |每批的最大大小,默认为1000|
+|inactive_timeout|可选的      |如果不活动,将刷新缓冲区的最大时间(以秒为单位),默认值为5s|
+|buffer_duration|可选的       |必须先处理批次中最旧条目的最大期限(以秒为单位),默认是5|
+|max_retry_count|可选的       |从处理管道中移除之前的最大重试次数;默认为零|
+|retry_delay    |可选的       |如果执行失败,应该延迟进程执行的秒数;默认为1|
+
+以下代码显示了如何使用批处理程序的示例。批处理处理器将要执行的功能作为第一个参数,将批处理配置作为第二个参数。
+
+```lua
+local bp = require("apisix.plugins.batch-processor")
+local func_to_execute = function(entries)
+            -- serialize to json array core.json.encode(entries)
+            -- process/send data
+            return true
+       end
+
+local config = {
+    max_retry_count  = 2,
+    buffer_duration  = 60,
+    inactive_timeout  = 5,
+    batch_max_size = 1,
+    retry_delay  = 0
+}
+
+
+local batch_processor, err = bp:new(func_to_execute, config)
+
+if batch_processor then
+    batch_processor:push({hello='world'})
+end
+```
+
+
+注意:请确保批处理的最大大小(条目数)在函数执行的范围内。
+刷新批处理的计时器基于“ inactive_timeout”配置运行。因此,为了获得最佳使用效果,
+保持“ inactive_timeout”小于“ buffer_duration”。
diff --git a/doc/plugins/kafka-logger-cn.md b/doc/plugins/kafka-logger-cn.md
index 53572f4..4ff9789 100644
--- a/doc/plugins/kafka-logger-cn.md
+++ b/doc/plugins/kafka-logger-cn.md
@@ -31,6 +31,11 @@
 
 这将提供将Log数据请求作为JSON对象发送到外部Kafka集群的功能。
 
+该插件提供了将Log Data作为批处理推送到外部Kafka主题的功能。如果您没有收到日志数据,请放心一些时间,它会在我们的批处理处理器中的计时器功能到期后自动发送日志。
+
+有关Apache APISIX中Batch-Processor的更多信息,请参考。
+[Batch-Processor](../batch-processor-cn.md)
+
 ## 属性列表
 
 |属性名称          |必选项  |描述|
diff --git a/doc/plugins/kafka-logger.md b/doc/plugins/kafka-logger.md
index 83316d3..c13ff89 100644
--- a/doc/plugins/kafka-logger.md
+++ b/doc/plugins/kafka-logger.md
@@ -32,6 +32,11 @@
 
 This will provide the ability to send Log data requests as JSON objects to external Kafka clusters.
 
+This plugin provides the ability to push Log data as a batch to you're external Kafka topics. In case if you did not recieve the log data don't worry give it some time it will automatically send the logs after the timer function expires in our Batch Processor.
+
+For more info on Batch-Processor in Apache APISIX please refer.
+[Batch-Processor](../batch-processor.md)
+
 ## Attributes
 
 |Name           |Requirement    |Description|
diff --git a/doc/plugins/tcp-logger-cn.md b/doc/plugins/tcp-logger-cn.md
index 27da9ff..ee260e6 100644
--- a/doc/plugins/tcp-logger-cn.md
+++ b/doc/plugins/tcp-logger-cn.md
@@ -31,6 +31,11 @@
 
 以实现将日志数据以JSON格式发送到监控工具或其它TCP服务的能力。
 
+该插件提供了将Log Data作为批处理推送到外部TCP服务器的功能。如果您没有收到日志数据,请放心一些时间,它会在我们的批处理处理器中的计时器功能到期后自动发送日志。
+
+有关Apache APISIX中Batch-Processor的更多信息,请参考。
+[Batch-Processor](../batch-processor-cn.md)
+
 ## 属性列表
 
 |属性名称          |必选项  |描述|
diff --git a/doc/plugins/tcp-logger.md b/doc/plugins/tcp-logger.md
index 7949444..435834b 100644
--- a/doc/plugins/tcp-logger.md
+++ b/doc/plugins/tcp-logger.md
@@ -31,6 +31,11 @@
 
 This will provide the ability to send Log data requests as JSON objects to Monitoring tools and other TCP servers.
 
+This plugin provides the ability to push Log data as a batch to you're external TCP servers. In case if you did not recieve the log data don't worry give it some time it will automatically send the logs after the timer function expires in our Batch Processor.
+
+For more info on Batch-Processor in Apache APISIX please refer.
+[Batch-Processor](../batch-processor.md)
+
 ## Attributes
 
 |Name           |Requirement    |Description|
diff --git a/doc/plugins/udp-logger-cn.md b/doc/plugins/udp-logger-cn.md
index 148a2af..67dde5a 100644
--- a/doc/plugins/udp-logger-cn.md
+++ b/doc/plugins/udp-logger-cn.md
@@ -31,6 +31,11 @@
 
 以实现将日志数据以JSON格式发送到监控工具或其它UDP服务的能力。
 
+此插件提供了将批处理数据批量推送到外部UDP服务器的功能。如果您没有收到日志数据,请放心一些时间,它会在我们的批处理处理器中的计时器功能到期后自动发送日志
+
+有关Apache APISIX中Batch-Processor的更多信息,请参考。
+[Batch-Processor](../batch-processor.md)
+
 ## 属性列表
 
 |属性名称          |必选项  |描述|
diff --git a/doc/plugins/udp-logger.md b/doc/plugins/udp-logger.md
index b7a36d2..8c0b069 100644
--- a/doc/plugins/udp-logger.md
+++ b/doc/plugins/udp-logger.md
@@ -31,6 +31,11 @@
 
 This will provide the ability to send Log data requests as JSON objects to Monitoring tools and other UDP servers.
 
+This plugin provides the ability to push Log data as a batch to you're external UDP servers. In case if you did not recieve the log data don't worry give it some time it will automatically send the logs after the timer function expires in our Batch Processor.
+
+For more info on Batch-Processor in Apache APISIX please refer.
+[Batch-Processor](../batch-processor.md)
+
 ## Attributes
 
 |Name           |Requirement    |Description|