Przeglądaj źródła

plugins: refactor influx pluglin name

RockyJin 4 lat temu
rodzic
commit
67096f2cb8

+ 2 - 2
.github/workflows/build_packages.yaml

@@ -67,8 +67,8 @@ jobs:
             matrix:
                 plugin:
                 - sinks/file
-                - sinks/influxdb
-                  # - sinks/taos
+                - sinks/influx
+              # - sinks/taos
                 - sinks/zmq
                 - sources/random
                 - sources/zmq

+ 1 - 1
Makefile

@@ -171,7 +171,7 @@ cross_docker: cross_prepare
 
 
 PLUGINS := sinks/file \
-	sinks/influxdb \
+	sinks/influx \
 	sinks/taos \
 	sinks/zmq \
 	sources/random \

+ 1 - 1
docs/en_US/plugins/overview.md

@@ -15,7 +15,7 @@ Kuiper implemented several plugins.
 | --------------------- | ------------------------------------------------------------ |
 | [file](sinks/file.md) | The sink is used for saving analysis result into a specified file. |
 | [zmq](sinks/zmq.md)   | The sink will publish the result into a Zero Mq topic                                                             |
-| [influxdb](sinks/influxdb.md)   | The sink will publish the result into a InfluxDB 
+| [influxdb](sinks/influx.md)   | The sink will publish the result into a InfluxDB 
 
 
 

+ 3 - 3
docs/en_US/plugins/sinks/influxdb.md

@@ -7,12 +7,12 @@ The sink will publish the result into a InfluxDB.
 Please make following update before compile the plugin,
 
 - Add Influxdb library reference in `go.mod`.
-- Remove the first line `// +build influxdb` of file `plugins/sinks/influxdb.go`.
+- Remove the first line `// +build plugins` of file `plugins/sinks/influx.go`.
 
 ```shell
 # cd $kuiper_src
-# go build --buildmode=plugin -o plugins/sinks/InfluxDB.so plugins/sinks/influxdb.go
-# zip influx.zip plugins/sinks/InfluxDB.so
+# go build --buildmode=plugin -o plugins/sinks/Influx.so plugins/sinks/influx.go
+# zip influx.zip plugins/sinks/Influx.so
 # cp influx.zip /root/tomcat_path/webapps/ROOT/
 # bin/cli create plugin sink influx -f /tmp/influxPlugin.txt
 # bin/cli create rule influx -f /tmp/influxRule.txt

+ 1 - 1
docs/zh_CN/plugins/overview.md

@@ -161,7 +161,7 @@ source 的大部分属性用户通过对应的配置文件指定,用户无法
 | --------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
 | [file](sinks/file.md) | 该插件将分析结果保存到某个指定到文件系统中 | 插件样例,不可用于生产环境 |
 | [zmq](sinks/zmq.md)   | 该插件将分析结果发送到 Zero Mq 的主题中  | 插件样例,不能用于生产环境 |
-| [Influxdb](sinks/influxdb.md)   | 该插件将分析结果发送到 InfluxDB 中  | 由 [@smart33690](https://github.com/smart33690) 提供 |
+| [Influxdb](sinks/influx.md)   | 该插件将分析结果发送到 InfluxDB 中  | 由 [@smart33690](https://github.com/smart33690) 提供 |
 | [TDengine](sinks/taos.md) | 该插件将分析结果发送到 TDengine 中 |  |
 
 ### sink 元数据文件格式

docs/zh_CN/plugins/sinks/influxdb.md → docs/zh_CN/plugins/sinks/influx.md


+ 9 - 9
etc/sinks/influxdb.json

@@ -1,10 +1,10 @@
 {
 	"about": {
-		"trial": false,
+		"trial": true,
 		"author": {
 			"name": "Yongxing Ma",
 			"email": "",
-			"company": "China Mobile",
+			"company": "",
 			"website": ""
 		},
 		"helpUrl": {
@@ -13,7 +13,7 @@
 		},
 		"description": {
 			"en_US": "This a sink plugin for InfluxDB, it can be used for saving the analysis data into InfluxDB.",
-			"zh_CN": "本插件为 InfluxDB 的持久化插件,可以用于将分析数据存入 InfluxDB 中"
+			"zh_CN": "本插件为 InfluxDB 的持久化插件,可以用于将分析数据存入 InfluxDB 中"
 		}
 	},
 	"libs": [
@@ -21,7 +21,7 @@
 	],
 	"properties": [{
 		"name": "addr",
-		"default": "",
+		"default": "http://192.168.100.245:8086",
 		"optional": true,
 		"control": "text",
 		"type": "string",
@@ -35,7 +35,7 @@
 		}
 	}, {
 		"name": "measurement",
-		"default": "",
+		"default": "test",
 		"optional": true,
 		"control": "text",
 		"type": "string",
@@ -77,7 +77,7 @@
 		}
 	}, {
 		"name": "databasename",
-		"default": "",
+		"default": "db",
 		"optional": true,
 		"control": "text",
 		"type": "string",
@@ -91,7 +91,7 @@
 		}
 	}, {
 		"name": "tagkey",
-		"default": "",
+		"default": "tagkey",
 		"optional": true,
 		"control": "text",
 		"type": "string",
@@ -105,7 +105,7 @@
 		}
 	}, {
 		"name": "tagvalue",
-		"default": "",
+		"default": "tagvalue",
 		"optional": true,
 		"control": "text",
 		"type": "string",
@@ -119,7 +119,7 @@
 		}
 	}, {
 		"name": "fields",
-		"default": "",
+		"default": "humidity,temperature,pressure",
 		"optional": true,
 		"control": "text",
 		"type": "string",

+ 4 - 4
etc/sinks/taos.json

@@ -1,6 +1,6 @@
 {
 	"about": {
-		"trial": false,
+		"trial": true,
 		"author": {
 			"name": "EMQ",
 			"email": "contact@emqx.io",
@@ -63,7 +63,7 @@
 		}
 	}, {
 		"name": "password",
-		"default": "",
+		"default": "taosdata",
 		"optional": false,
 		"control": "text",
 		"type": "string",
@@ -77,7 +77,7 @@
 		}
 	}, {
 		"name": "database",
-		"default": "",
+		"default": "db",
 		"optional": false,
 		"control": "text",
 		"type": "string",
@@ -91,7 +91,7 @@
 		}
 	}, {
 		"name": "table",
-		"default": "",
+		"default": "t",
 		"optional": false,
 		"control": "text",
 		"type": "string",

plugins/sinks/influxdb.go → plugins/sinks/influx.go