-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from cita-cloud/add_kafka_testcase
add kafka exporter testcase
- Loading branch information
Showing
36 changed files
with
30,549 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
test/operations/resource/overlord/test-chain-overlord-node4/cm-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
test/operations/resource/raft/test-chain-raft-node4/cm-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
import os | ||
import json | ||
import subprocess | ||
import time | ||
import pymysql | ||
|
||
if os.getenv("CHAIN_TYPE") == "raft": | ||
print("raft chain don't need to execute exporter latency test") | ||
exit(0) | ||
|
||
# send tx and get tx hash | ||
cmd = "cldi -c default send 0xffffffffffffffffffffffffffffffffff010000 0xabcd" | ||
tx_hash = subprocess.getoutput(cmd).strip() | ||
print(tx_hash) | ||
time1 = time.time() | ||
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time1))) | ||
|
||
# get receipt | ||
while True: | ||
time.sleep(1) | ||
cmd = "cldi -c default get receipt {}".format(tx_hash) | ||
result = subprocess.getoutput(cmd) | ||
if not result.__contains__("Error"): | ||
receipt = json.loads(result) | ||
print(receipt) | ||
time2 = time.time() | ||
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time2))) | ||
break | ||
|
||
# query from doris | ||
# 打开数据库连接 | ||
doris_host="doriscluster-sample-storageclass1-fe-internal.{}.svc.cluster.local".format(os.getenv("NAMESPACE")) | ||
db = pymysql.connect(host=doris_host, | ||
port=9030, | ||
user='root', | ||
password='', | ||
database='citacloud') | ||
|
||
# 使用 cursor() 方法创建一个游标对象 cursor | ||
cursor = db.cursor() | ||
|
||
# 使用 execute() 方法执行 SQL 查询 | ||
hash = "\"{}\"".format(tx_hash[2:]) | ||
|
||
while True: | ||
time.sleep(1) | ||
cursor.execute("SELECT * from receipts where tx_hash={}".format(hash)) | ||
results = cursor.fetchall() | ||
if results: | ||
print(results) | ||
time3 = time.time() | ||
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time3))) | ||
break | ||
|
||
db.close() | ||
|
||
print("Done") | ||
print("finalize latency: ", time2 - time1) | ||
print("export latency: ", time3 - time2) |
Oops, something went wrong.