diff --git a/docs-examples/python/subscribe_demo.py b/docs-examples/python/subscribe_demo.py index bb71a62344e97d84b957e4895324600f6a6df97d..db9d49c3f4f8122634800c02a683d4cb022a7ba0 100644 --- a/docs-examples/python/subscribe_demo.py +++ b/docs-examples/python/subscribe_demo.py @@ -27,12 +27,12 @@ def query_callback(p_sub, p_result, p_param, code): if __name__ == '__main__': - conn = taos.connect(host="192.168.0.101",user="root",password="taosdata") + conn = taos.connect() restart = True topic = "topic-meter-current-bg" - sql = "select * from test.meters where current > 10" # Error sql + sql = "select * from power.meters where current > 10" # Error sql interval = 2000 # consumption interval in microseconds. - _ = conn.subscribe(restart, topic, sql, interval) + _ = conn.subscribe(restart, topic, sql, interval, query_callback) # Note: we received the return value as _ above, to avoid the TaosSubscription object to be deleted by gc. while True: time.sleep(10) # use Ctrl + C to interrupt diff --git a/output.txt b/output.txt deleted file mode 100644 index a27235060942e90f8dd65ef6d612b8f87d99e183..0000000000000000000000000000000000000000 --- a/output.txt +++ /dev/null @@ -1,6 +0,0 @@ -[06/13 14:00:51.480051] INFO: start creating 100 table(s) with 8 thread(s) -Spent 0.2650 seconds to create 100 table(s) with 8 thread(s), already exist 0 table(s), actual 100 table(s) pre created, 0 table(s) will be auto created -Spent 0.0251 seconds to insert rows: 20000, affected rows: 20000 with 8 thread(s) into test 796527.14 records/second - -insert delay, min: 0.16ms, avg: 0.96ms, p90: 1.50ms, p95: 3.00ms, p99: 10.50ms, max: 10.50ms -