@@ -6,25 +6,47 @@ TDengine can be quickly integrated with [Grafana](https://www.grafana.com/), an
...
@@ -6,25 +6,47 @@ TDengine can be quickly integrated with [Grafana](https://www.grafana.com/), an
### Install Grafana
### Install Grafana
TDengine currently supports Grafana 6.2 and above. You can download and install the package from Grafana website according to the current operating system. The download address is as follows:
TDengine currently supports Grafana 7.0 and above. You can download and install the package from Grafana website according to the current operating system. The download address is as follows: <https://grafana.com/grafana/download>.
https://grafana.com/grafana/download.
### Configure Grafana
### Configure Grafana
Download grafana plugin from <https://github.com/taosdata/grafanaplugin/releases/latest> .
TDengine data source plugin for Grafana is hosted on GitHub, refer to GitHub latest release page <https://github.com/taosdata/grafanaplugin/releases/latest> to download the latest plugin package. Currently it's version 3.1.3 .
It is recommended to use [`grafana-cli` command line tool](https://grafana.com/docs/grafana/latest/administration/cli/) to install the plugin.
Grafana will check the signature after 7.3 and 8.x for security. Users need additional configurations in `grafana.ini` file to allow unsigned plugins like TDengine data source.
tdSql.error("select %s( jtag->'location'='beijing') from jsons1 ;"%fn)
tdSql.error("select %s( jtag contains 'age') from jsons1 ;"%fn)
# Select_exprs is SQL function -Calculation function
# Select_exprs is SQL function -Calculation function
tdSql.error(" select diff(dataint) from jsons1 where jtag->'location'= 'beijing' or jtag->'location'= 'tianjing'or jtag contains 'num' or jtag->'age'=35 ;")
tdSql.error(" select diff(dataint) from jsons1 where jtag->'location'= 'beijing' or jtag->'location'= 'tianjing'or jtag contains 'num' or jtag->'age'=35 ;")
...
@@ -500,13 +547,21 @@ class TDTestCase:
...
@@ -500,13 +547,21 @@ class TDTestCase:
tdSql.query("select ts,round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.query("select ts,round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.query("select round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.query("select round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.error("select %s( jtag->'location'='beijing') from jsons1 ;"%fn)
tdSql.error("select %s( jtag contains 'age') from jsons1 ;"%fn)
#modify one same key and diffirent data type,include negative number of double
#modify one same key and diffirent data type,include negative number of double
tdSql.execute("insert into jsons7_4 using jsons7 tags('{\"nv\":null,\"tea\":123,\"tag\":123,\"tea\":false}') values (now+1s,5,'true',4.01,2.2,'abc'); ")
tdSql.execute("insert into jsons7_4 using jsons7 tags('{\"nv\":null,\"tea\":123,\"tag\":123,\"tea\":false}') values (now+1s,5,'true',4.01,2.2,'abc'); ")
tdSql.execute("insert into jsons7_5 using jsons7 tags('{\"nv\":null,\"tea\":\"app\",\"tag\":123,\"tea\":false}') values (now+2s,5,'true',4.01,2.2,'abc'); ")
tdSql.execute("insert into jsons7_5 using jsons7 tags('{\"nv\":null,\"tea\":\"app\",\"tag\":123,\"tea\":false}') values (now+2s,5,'true',4.01,2.2,'abc'); ")
tdSql.error("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111111111111111111111111111111111111111111111111111111111111111,\"tag\":123,\"tea\":false}') values (now+3s,5,'true',4.01,2.2,'123'); ")
tdSql.error("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111111111111111111111111111111111111111111111111111111111111111,\"tag\":123,\"tea\":false}') values (now+3s,5,'true',4.01,2.2,'123'); ")
tdSql.execute("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111,\"tag\":123,\"tea\":false}') values (now,5,'false',4.01,2.2,'t123'); ")
tdSql.execute("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111,\"tag\":123,\"tea\":false}') values (now,5,'false',4.01,2.2,'t123'); ")
tdSql.query("select jtag from jsons7 where jtag->'tea'>-1.01;")
tdSql.query("select jtag from jsons7 where jtag->'tea'<-1.01;")
# tdSql.checkRows(2)
tdSql.checkRows(1)
# test join
# test join
tdSql.execute("create table if not exists jsons6(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50)) tags(jtag json)")
tdSql.execute("create table if not exists jsons6(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50)) tags(jtag json)")
...
@@ -572,6 +627,36 @@ class TDTestCase:
...
@@ -572,6 +627,36 @@ class TDTestCase:
tdSql.query(" select stddev(dataint) from jsons8 group by datatime;")
tdSql.query(" select stddev(dataint) from jsons8 group by datatime;")
tdSql.error(" select stddev(datatime) from jsons8 group by datadouble;")
tdSql.error(" select stddev(datatime) from jsons8 group by datadouble;")
# # verify the tag length of the super table and the child table
# TD-12389
# tdSql.query("describe jsons1;")
# jtagLengthSup=tdSql.queryResult[3][2]
# tdSql.query("describe jsons1_1;")
# tdSql.checkData(3, 2, jtagLengthSup)
# #test import and export
# tdSql.execute("select * from jsons1 >> jsons1_data.csv;")
this test case is an test case for cache error , it will let the cached data obtained by the client that has connected to taosd incorrect,
this test case is an test case for unexpectd crash for session function , it will coredump taoshell ;
root cause : table schema is changed, tag hostname size is increased through schema-less insertion. The schema cache of client taos is not refreshed.
'''
'''
return
return
...
@@ -81,9 +81,6 @@ class TDTestCase:
...
@@ -81,9 +81,6 @@ class TDTestCase:
cfgPath=projPath+"/sim/dnode1/cfg "
cfgPath=projPath+"/sim/dnode1/cfg "
returncfgPath
returncfgPath
defrun(self):
defrun(self):
tdSql.prepare()
tdSql.prepare()
...
@@ -91,17 +88,17 @@ class TDTestCase:
...
@@ -91,17 +88,17 @@ class TDTestCase:
tdSql.execute("use testdb;")
tdSql.execute("use testdb;")
tdSql.execute("create stable st (ts timestamp , id int , value double) tags(hostname binary(10) ,ind int);")
tdSql.execute("create stable st (ts timestamp , id int , value double) tags(hostname binary(10) ,ind int);")
foriinrange(self.num):
foriinrange(self.num):
tdSql.execute("insert into sub_%s using st tags('host_%s' , %d) values (%d , %d , %f );"%(str(i),str(i),i*10,self.ts+100*i,i*2,i+10.00))
tdSql.execute("insert into sub_%s using st tags('host_%s' , %d) values (%d , %d , %f );"%(str(i),str(i),i*10,self.ts+200*i,i*2,i+10.00))
tdSql.execute("insert into sub_%s using st tags('host_%s' , %d) values (%d , %d , %f );"%(str(i),str(i),i*10,self.ts+300*i,i*2,i+10.00))
tdSql.execute("insert into sub_%s using st tags('host_%s' , %d) values (%d , %d , %f );"%(str(i),str(i),i*10,self.ts+10000*i,i*2,i+10.00))
tdSql.execute("insert into sub_%s using st tags('host_%s' , %d) values (%d , %d , %f );"%(str(i),str(i),i*10,self.ts+10000*i,i*2,i+10.00))
tdSql.query('select elapsed(ts,10s) from sub_1 where ts>="2015-01-01 00:00:00.000" and ts < "2015-01-01 00:10:00.000" session(ts,1d) ;')
cfg_path=self.getcfgPath()
cfg_path=self.getcfgPath()
print(cfg_path)
print(cfg_path)
# tdSql.execute('select elapsed(ts,10s) from st where ts>="2015-01-01 00:00:00.000" and ts < "2015-01-01 00:10:00.000" session(ts,1d) group by tbname;') # session not support super table
tdSql.execute('select elapsed(ts,10s) from testdb.st where ts>=\"2015-01-01 00:00:00.000\" and ts < \"2015-01-01 00:10:00.000\" session(ts,1d) group by tbname;')# session not support super table
os.system("taos -c %s -s 'select elapsed(ts,10s) from testdb.st where ts>=\"2015-01-01 00:00:00.000\" and ts < \"2015-01-01 00:10:00.000\" session(ts,1d) group by tbname;' "%(cfg_path))
taos_cmd1="taos -c %s -s 'select elapsed(ts,10s) from testdb.st where ts>=\"2015-01-01 00:00:00.000\" and ts < \"2015-01-01 00:10:00.000\" session(ts,1d) group by tbname;' "%(cfg_path)