【问题标题】:Profiling asp.net core 2 (web api) with angular 5使用角度 5 分析 asp.net core 2 (web api)
【发布时间】:2018-06-24 19:13:01
【问题描述】:

我正在寻找以下环境的分析解决方案,请有人建议。

  • net471 上的 ASP.NET Core 2
  • EntityFramework 6.2.0
  • Angular 5.0.0

我研究了 MiniProfilerGlimpse

  • Glimpse 尚未升级到 Core 2.0。
  • MiniProfiler 适用于 Core 2,但不适用于 SPA。有人尝试扩展 Angular 2http,但我认为 Angular 5 现在使用 HttpClientinterceptor
  • 我也不知道如何使用 MiniProfile 分析 DataContext (System.Data.Linq) 以进行 SQL 分析。文档建议 Connection 包装方法。我猜这是一个单独的问题。

【问题讨论】:

  • 这里的“Application Insights”可以提供帮助吗?

标签: angular profiling asp.net-core-2.0 mvc-mini-profiler glimpse


【解决方案1】:

如果您关注文档 (https://miniprofiler.com/dotnet/AspDotNetCore),您应该可以选择服务器端。甚至可以将其与 EF 集成。

对于 Angular 5 集成,我受到这篇文章的启发,编写了一个 http 拦截器: https://blog.dangl.me/archive/using-the-stackexchange-miniprofiler-with-an-angular-single-page-application/

【讨论】:

  • 仅供参考 - 您可以调用 MiniProfiler.Current.RenderIncludes(HttpContext) 来生成加载工具客户端所需的 <script> 标签。您必须决定如何/在何处将该脚本标签注入您的 SPA
猜你喜欢
  • 2019-03-04
  • 2018-12-30
  • 2018-08-25
  • 2019-08-06
  • 2018-04-23
  • 2018-11-25
  • 2018-10-28
  • 2020-05-18
  • 2018-03-22
相关资源
最近更新 更多