排查代码优化 (预览版) 问题

本文提供使用适用于 Microsoft Azure 的 Application Insights 代码优化的故障排除步骤和信息。

故障排除清单

步骤 1:观看有关代码优化设置的视频

观看以下演示视频,了解如何正确设置代码优化。

步骤 2:确保应用已连接到 Application Insights 资源

创建 Application Insights 资源 并验证它是否已连接到正确的应用。

步骤 3:验证是否已启用 Application Insights Profiler

启用 Application Insights Profiler

步骤 4:验证 Application Insights Profiler 是否正在收集配置文件

若要确保配置文件上传到 Application Insights 资源,请执行以下步骤:

  1. Azure 门户中,搜索并选择“Application Insights”。

  2. 在 Application Insights 资源列表中,选择资源的名称。

  3. 在 Application Insights 资源的导航窗格中,找到 “调查 ”标题,然后选择“ 性能”。

  4. 在 Application Insights 资源的“ 性能 ”页上,选择“ 探查器”:

    Azure 门户显示如何导航到 Application Insights Profiler 的屏幕截图。

  5. “Application Insights Profiler ”页上,查看 “最近的分析会话” 部分。

    Azure 门户 Application Insights Profiler 页的屏幕截图。

    注意

    如果未看到任何分析会话,请参阅 Application Insights Profiler 疑难解答

步骤 5:定期检查探查器

成功完成前面的步骤后,请继续检查探查器以获取见解。 同时,服务会继续分析你的配置文件,并在检测到代码中的任何问题后立即提供见解。 启用 Application Insights Profiler 后,可能需要几个小时才能生成配置文件,并让服务分析配置文件。 如果服务未检测到代码中的问题,将显示一条消息,确认未找到任何见解。

联系我们寻求帮助

如果你有任何疑问或需要帮助,请创建支持请求联系 Azure 社区支持。 还可以向 Azure 反馈社区提交产品反馈。