提交 1698e3e1 编写于 作者: L Liangliang He

Add customized metrics endpoint

上级 d53bea43
......@@ -33,10 +33,11 @@ def ops_benchmark_stdout_processor(stdout, device_properties, abi):
line = line.strip()
parts = line.split()
if len(parts) == 5 and parts[0].startswith("BM_"):
metrics["%s.ops_benchmark_time_ms" % parts[0]] = str(float(parts[1])/1000000.0)
metrics["%s.ops_benchmark_input_mb_per_sec" % parts[0]] = parts[3]
metrics["%s.ops_benchmark_gmacc_per_sec" % parts[0]] = parts[4]
sh_commands.falcon_push_metrics(metrics, device_properties, abi)
metrics["%s.time_ms" % parts[0]] = str(float(parts[1])/1000000.0)
metrics["%s.input_mb_per_sec" % parts[0]] = parts[3]
metrics["%s.gmacc_per_sec" % parts[0]] = parts[4]
sh_commands.falcon_push_metrics(metrics, device_properties, abi,
endpoint="mace_ops_benchmark")
def parse_args():
"""Parses command line arguments."""
......
......@@ -138,7 +138,7 @@ def gen_mace_version(codegen_path="mace/codegen"):
def falcon_tags(platform, model, abi):
return "ro.board.platform=%s,ro.product.model=%s,abi=%s" % (platform, model, abi)
def falcon_push_metrics(metrics, device_properties, abi):
def falcon_push_metrics(metrics, device_properties, abi, endpoint="mace_dev"):
cli = falcon_cli.FalconCli.connect(server="transfer.falcon.miliao.srv",
port=8433,
debug=False)
......@@ -147,7 +147,7 @@ def falcon_push_metrics(metrics, device_properties, abi):
tags = falcon_tags(platform, model, abi)
ts = int(time.time())
falcon_metrics = [{
"endpoint": "mace_dev",
"endpoint": endpoint,
"metric": key,
"tags": tags,
"timestamp": ts,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册