-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Trace api #70752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trace api #70752
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
def start_api_tracer(api_path, save_config_path): | ||
import paddle | ||
|
||
print(paddle.__version__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议使用 logging
setattr(HookAPIMap, api, getattr(eval(parent_package), method_name)) | ||
setattr(eval(parent_package), method_name, wrapped_api(api)) | ||
except Exception as err: | ||
print("[api_tracer error] : start_api_tracer ", api, str(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
save_config_path = os.environ.get( | ||
"FLAGS_trace_api_save_config_path", "api_configs.txt" | ||
) | ||
start_api_tracer(api_path, save_config_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议整合一下 FLAG
result = result + key + "=" + tmp + ", " | ||
|
||
result = result + ")" | ||
# self.file.write(") -> ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete unused code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Category
Execute Infrastructure
PR Types
New features
Description
增加抓取API调用配置的能力,抓取的API配置可用于自动化测试。
用法:
Pcard-67164