未验证 提交 7c173acc 编写于 作者: X Xin.Zh 提交者: GitHub

add license header (#7197)

上级 6d9c6d3b
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package app package app
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package expr package expr
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package expr package expr
import "testing" import "testing"
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package expr package expr
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package expr package expr
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package app package app
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package app package app
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package app package app
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package models package models
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package models package models
import "time" import "time"
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package utils package utils
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package log package log
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package dataimport package dataimport
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package main package main
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
...@@ -184,7 +199,7 @@ func exec(client *http.Client, sql string) { ...@@ -184,7 +199,7 @@ func exec(client *http.Client, sql string) {
if (request < 103) { if (request < 103) {
return return
} }
atomic.AddInt64(&period, spend) atomic.AddInt64(&period, spend)
if request%5000 == 0 && request != 0 { if request%5000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request) requestAvg := float64(period) / float64(1000000) / float64(request)
...@@ -204,7 +219,7 @@ func insertTable(conn int) { ...@@ -204,7 +219,7 @@ func insertTable(conn int) {
tbStart := conn*config.TablePerConn + config.TableStart tbStart := conn*config.TablePerConn + config.TableStart
tmStart := config.DataBegin tmStart := config.DataBegin
for j := 0; j < config.DataNum; j++ { for j := 0; j < config.DataNum; j++ {
for i := 0; i < config.TablePerConn; i++ { for i := 0; i < config.TablePerConn; i++ {
tmVal := int64(j)*int64(config.DataInterval) + tmStart + 1 tmVal := int64(j)*int64(config.DataInterval) + tmStart + 1
...@@ -214,7 +229,7 @@ func insertTable(conn int) { ...@@ -214,7 +229,7 @@ func insertTable(conn int) {
if config.DataRandom { if config.DataRandom {
dataVal = rand.Intn(1000) dataVal = rand.Intn(1000)
} }
sql := fmt.Sprintf("import into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal) sql := fmt.Sprintf("import into %s.%s%d values(%d, %d)", config.DbName, config.TablePrefix, tbIndex, tmVal, dataVal)
exec(client, sql) exec(client, sql)
time.Sleep(time.Millisecond * time.Duration(10)) time.Sleep(time.Millisecond * time.Duration(10))
...@@ -282,7 +297,7 @@ func selectData(wg *sync.WaitGroup, conn int) { ...@@ -282,7 +297,7 @@ func selectData(wg *sync.WaitGroup, conn int) {
client := &http.Client{} client := &http.Client{}
tbStart := conn*config.TablePerConn + config.TableStart tbStart := conn*config.TablePerConn + config.TableStart
for j := 0; j < config.DataNum; j++ { for j := 0; j < config.DataNum; j++ {
tbIndex := 0 + tbStart tbIndex := 0 + tbStart
...@@ -292,10 +307,10 @@ func selectData(wg *sync.WaitGroup, conn int) { ...@@ -292,10 +307,10 @@ func selectData(wg *sync.WaitGroup, conn int) {
sql += fmt.Sprintf(",'%s%d'", config.TablePrefix, tbIndex) sql += fmt.Sprintf(",'%s%d'", config.TablePrefix, tbIndex)
} }
sql += ") group by orgno" sql += ") group by orgno"
//sql := fmt.Sprintf("select count(*) from db.mt") //sql := fmt.Sprintf("select count(*) from db.mt")
//sql := fmt.Sprintf("select max(i),min(i) from db.mt", config.TablePrefix, tbIndex) //sql := fmt.Sprintf("select max(i),min(i) from db.mt", config.TablePrefix, tbIndex)
exec(client, sql) exec(client, sql)
time.Sleep(time.Millisecond * time.Duration(10)) time.Sleep(time.Millisecond * time.Duration(10))
} }
...@@ -303,17 +318,17 @@ func selectData(wg *sync.WaitGroup, conn int) { ...@@ -303,17 +318,17 @@ func selectData(wg *sync.WaitGroup, conn int) {
func main() { func main() {
filename := flag.String("config", "taos_cloud.json", "config file name") filename := flag.String("config", "taos_cloud.json", "config file name")
flag.Parse() flag.Parse()
readFile(*filename) readFile(*filename)
fmt.Println("\n================http test start======================") fmt.Println("\n================http test start======================")
var wg sync.WaitGroup var wg sync.WaitGroup
fmt.Println("\n================select data ========================") fmt.Println("\n================select data ========================")
for i := 0; i < config.ConnNum; i++ { for i := 0; i < config.ConnNum; i++ {
wg.Add(1) wg.Add(1)
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
...@@ -184,7 +199,7 @@ func exec(client *http.Client, sql string) { ...@@ -184,7 +199,7 @@ func exec(client *http.Client, sql string) {
if (request < 103) { if (request < 103) {
return return
} }
atomic.AddInt64(&period, spend) atomic.AddInt64(&period, spend)
if request%5000 == 0 && request != 0 { if request%5000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request) requestAvg := float64(period) / float64(1000000) / float64(request)
...@@ -333,11 +348,11 @@ func selectData(wg *sync.WaitGroup, conn int) { ...@@ -333,11 +348,11 @@ func selectData(wg *sync.WaitGroup, conn int) {
func main() { func main() {
filename := flag.String("config", "taos_cloud.json", "config file name") filename := flag.String("config", "taos_cloud.json", "config file name")
flag.Parse() flag.Parse()
readFile(*filename) readFile(*filename)
fmt.Println("\n================http test start======================") fmt.Println("\n================http test start======================")
var wg sync.WaitGroup var wg sync.WaitGroup
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
...@@ -184,7 +199,7 @@ func exec(client *http.Client, sql string) { ...@@ -184,7 +199,7 @@ func exec(client *http.Client, sql string) {
if (request < 103) { if (request < 103) {
return return
} }
atomic.AddInt64(&period, spend) atomic.AddInt64(&period, spend)
if request%5000 == 0 && request != 0 { if request%5000 == 0 && request != 0 {
requestAvg := float64(period) / float64(1000000) / float64(request) requestAvg := float64(period) / float64(1000000) / float64(request)
...@@ -256,7 +271,7 @@ func insertTable(conn int) { ...@@ -256,7 +271,7 @@ func insertTable(conn int) {
sql += fmt.Sprintf("(%d, %d)", tmVal, dataVal) sql += fmt.Sprintf("(%d, %d)", tmVal, dataVal)
} }
exec(client, sql) exec(client, sql)
if config.WaitTime != 0 { if config.WaitTime != 0 {
time.Sleep(time.Millisecond * time.Duration(config.WaitTime)) time.Sleep(time.Millisecond * time.Duration(config.WaitTime))
...@@ -333,11 +348,11 @@ func selectData(wg *sync.WaitGroup, conn int) { ...@@ -333,11 +348,11 @@ func selectData(wg *sync.WaitGroup, conn int) {
func main() { func main() {
filename := flag.String("config", "taos_cloud.json", "config file name") filename := flag.String("config", "taos_cloud.json", "config file name")
flag.Parse() flag.Parse()
readFile(*filename) readFile(*filename)
fmt.Println("\n================http test start======================") fmt.Println("\n================http test start======================")
var wg sync.WaitGroup var wg sync.WaitGroup
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
...@@ -68,7 +83,7 @@ func readConf(filename string) { ...@@ -68,7 +83,7 @@ func readConf(filename string) {
fmt.Println("LoopNum:", config.LoopNum) fmt.Println("LoopNum:", config.LoopNum)
fmt.Println("dbName:", config.DbName) fmt.Println("dbName:", config.DbName)
fmt.Println("dataBegin:", config.DataBegin) fmt.Println("dataBegin:", config.DataBegin)
fmt.Println("================http token=============================") fmt.Println("================http token=============================")
token, err = getToken() token, err = getToken()
url = fmt.Sprintf("http://%s:%d/telegraf/%s", config.HostIp, 6020, config.DbName) url = fmt.Sprintf("http://%s:%d/telegraf/%s", config.HostIp, 6020, config.DbName)
...@@ -90,9 +105,9 @@ func readReq(filename string) { ...@@ -90,9 +105,9 @@ func readReq(filename string) {
defer file.Close() defer file.Close()
data, _ := ioutil.ReadAll(file) data, _ := ioutil.ReadAll(file)
template = string(data[:]) template = string(data[:])
//fmt.Println(template) //fmt.Println(template)
} }
...@@ -154,13 +169,13 @@ func exec(client *http.Client, sql string) { ...@@ -154,13 +169,13 @@ func exec(client *http.Client, sql string) {
var jsonResult JsonResult var jsonResult JsonResult
err = json.Unmarshal(data, &jsonResult) err = json.Unmarshal(data, &jsonResult)
if err != nil { if err != nil {
fmt.Println("parse json error: ", string(data[:])) fmt.Println("parse json error: ", string(data[:]))
resp.Body.Close() resp.Body.Close()
continue continue
} }
atomic.AddInt64(&request, 1) atomic.AddInt64(&request, 1)
atomic.AddInt64(&period, spend) atomic.AddInt64(&period, spend)
if request%1000 == 0 && request != 0 { if request%1000 == 0 && request != 0 {
...@@ -179,16 +194,16 @@ func exec(client *http.Client, sql string) { ...@@ -179,16 +194,16 @@ func exec(client *http.Client, sql string) {
func writeData(wg *sync.WaitGroup, tbIndex int) { func writeData(wg *sync.WaitGroup, tbIndex int) {
defer wg.Done() defer wg.Done()
client := &http.Client{} client := &http.Client{}
tbName := fmt.Sprintf("t%d", tbIndex) tbName := fmt.Sprintf("t%d", tbIndex)
for j := 0; j < config.LoopNum; j++ { for j := 0; j < config.LoopNum; j++ {
tmVal := fmt.Sprintf("%d", int64(j)*int64(10000) + config.DataBegin) tmVal := fmt.Sprintf("%d", int64(j)*int64(10000) + config.DataBegin)
//fmt.Println(tmVal) //fmt.Println(tmVal)
req1 := strings.Replace(template, "panshi-gsl", tbName, -1) req1 := strings.Replace(template, "panshi-gsl", tbName, -1)
req2 := strings.Replace(req1, "1536750390000", tmVal, -1) req2 := strings.Replace(req1, "1536750390000", tmVal, -1)
//fmt.Println(req2) //fmt.Println(req2)
exec(client, req2) exec(client, req2)
} }
...@@ -196,17 +211,17 @@ func writeData(wg *sync.WaitGroup, tbIndex int) { ...@@ -196,17 +211,17 @@ func writeData(wg *sync.WaitGroup, tbIndex int) {
func main() { func main() {
filename := flag.String("config", "telegraf.json", "config file name") filename := flag.String("config", "telegraf.json", "config file name")
flag.Parse() flag.Parse()
readReq("telegraf.req") readReq("telegraf.req")
readConf(*filename) readConf(*filename)
fmt.Println("\n================telegraf test start======================") fmt.Println("\n================telegraf test start======================")
var wg sync.WaitGroup var wg sync.WaitGroup
for i := 0; i < config.MachineNum; i++ { for i := 0; i < config.MachineNum; i++ {
wg.Add(1) wg.Add(1)
go writeData(&wg, i) go writeData(&wg, i)
......
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package main package main
import ( import (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册