使用性能分析运行Aim

Aim内置了性能分析功能,它会将所有发送至后端的API请求记录到您代码仓库内的一个目录中。我们采用pyinstrument作为底层分析器。如需启用性能分析,请运行带--profiler参数的aim up命令。

$ aim up --profiler

This will instruct backend to create a new directory inside your repository (.aim/profler). On every api call, profiler will create an .html file containing whole run trace of that api. Basically you can navigate into that directory and open the file in your browser to see where’s the performance bottleneck.

为什么需要启用性能分析.

其实你不需要,除非我们明确要求你这样做,以防你在使用Aim时遇到任何性能问题。

请注意,开启性能分析时不会向我们发送任何数据。所有数据均存储在本地,由终端用户自行管理。