问题标签 [miniprofiler]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1250 浏览

webforms - MiniProfiler 和 WebForms

所以我正在尝试将 MiniProfiler ( https://github.com/MiniProfiler/dotnet ) 用于 WebForms 网站。我所做的是:

  1. 使用 nuget 安装包
  2. 在 Global.asax.cs 中添加 MiniProfiler 初始化(Begin_request 和 End_request 事件)
  3. 添加 <%= StackExchange.Profiling.MiniProfiler.RenderIncludes() %> 语句

  4. 设置在 web.comfig

而且 MiniProfiler 仍然不起作用。简单的故障排除表明(在 Chrome 开发工具中)我希望在该页面上看到 MiniProfiler,我看到了

http://localhost/mycoolsite/mini-profiler-resources/results 404.0 - 未找到

更多信息:我使用 .Net FW 4.5.1、IIS8 和 Intergated Mode(应用程序池)

有什么想法对我有用吗?

0 投票
0 回答
230 浏览

miniprofiler - 在控制台应用程序中输出 SQL 语句

我们对代码进行了检测,以便在 MVC5 应用程序中,我们可以看到实际执行的 SQL。我们在 _layout.cshtml 文件中使用 @MiniProfiler.RenderIncludes() 显示信息。我们配置 miniprofiler 如下

我们想在批处理控制台应用程序中使用 miniprofiler 来显示实际执行的 SQL。我们正在考虑使用 Windows.Miniprofiler nuGet 包,但它不适用于当前的 miniprofiler 版本 3.2.0.157。当我们尝试使用下面的代码查看结果时,没有显示 SQL 语句。

关于如何做到这一点的任何建议?

0 投票
0 回答
586 浏览

mvc-mini-profiler - 如何防止发布到生产中的迷你分析器资源/结果?

我正在尝试将 MiniProfiler 设置为在我们所有的环境中运行,而不仅仅是在我们的本地机器上运行。据我了解,StackOverflow 在生产环境中运行 MiniProfiler 没有任何问题。当我在 Chrome 中打开我的开发人员工具并转到 StackOverflow 网站上的网络选项卡时,我没有看到以下 URL 的任何帖子:

当我查看我们网站上的网络选项卡时,我确实看到了许多指向此 URL 的帖子。我在 Global.cs 中使用的代码是:

我在这里做错了吗?我唯一能想到的是它没有启动分析会话,但它不会分析用户请求。MiniProfiler UI 没有显示,因此该部分工作正常,但是所有请求仍在发出,RenderIncludes 方法正在将 js 代码加载到 DOM 中。

谢谢!

0 投票
1 回答
685 浏览

c# - 我怎样才能让 Miniprofiler 只调用可能记录配置文件消息的方法

我正在构建一个 Windows 服务。

我正在尝试使用 miniprofiler,拦截 ado.net 调用并将消息传递给我的应用程序的日志记录系统。

所有 miniprofiler 需要做的就是调用一个静态方法 Log(string text)。

我浏览了以下帖子并学习了如何拦截 ado.net 调用:

使用 MiniProfiler 进行直接 ADO.net 调用

似乎唯一未解决的难题是让 miniprofile 调用我的 log 方法。我怎样才能做到这一点?

我浏览了网站 http://miniprofiler.com/,但文档很少。

0 投票
1 回答
293 浏览

c# - LightInject - 拦截不拦截依赖项

我在 MVC 网站上将 LightInject 与 ServiceProvider 适配器一起使用。我正在尝试将其连接到 MiniProfiler,但我运气不佳。MiniProfiler 似乎正在捕获 MVC 控制器生命周期,但没有捕获任何依赖项: Mini Profiler Image Profiling Dump(我在此屏幕截图中进行调试 - 忽略 61,744 毫秒的持续时间)

这就是我初始化容器的方式:

拦截器如下所示:

这是控制器和测试依赖项:

我在拦截器代码中设置了一个断点。它从不为任何事情进入拦截器SomeDependency,但它为 MVC 生命周期中的每个操作进入SomeDependencyController

0 投票
1 回答
95 浏览

asp.net - MiniProfiler 页面每次请求加载两次

我把它归结为最小的例子:

测试.aspx

(后面的代码是空的)

全球.asax

这会产生结果:

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

谁能向我解释这里发生了什么?我希望只有一个显示。

0 投票
1 回答
60 浏览

neo4j - 将 Miniprofiler 与 Neo4j 图形数据库一起使用

我正在玩Neo4j社区版,使用Neo4jClient for .net,并寻找一种使用出色的Miniprofiler调用 Neo4j DB 的方法。

我在其他一些带有 SQL Server 和实体框架的项目中使用了 miniprofiler,并获得了关于发送到数据库的查询的精彩见解。想知道我是否可以通过 Neo4j 和 Cypher 查询获得相同的结果。

0 投票
1 回答
279 浏览

c# - MiniProfiler results UI shows empty names since using SqlServerStorage

We have been using MiniProfiler as a simple way to profile our ASP.NET MVC 5 application performance. It worked well in dev, but as soon as we put the application into staging on a web farm, we soon realised we needed to use a different/shared storage medium.

We migrated to SqlServerStorage by putting

MiniProfiler.Settings.Storage = new SqlServerStorage(System.Configuration.ConfigurationManager.ConnectionStrings["SqlDb"].ConnectionString)

into MvcApplication.Application_Start (Global.asax)

We created the MiniProfiler tables using the script in StackExchange.Profiling.Storage.SqlServerStorage.TableCreationScript.

Since using SqlServerStorage, we have found that the MiniProfiler UI no longer functions properly; we get the following: screenshot

As you can see, the name column is empty. Anyone any ideas whether I need to configure something else?

0 投票
0 回答
51 浏览

mysql - 无法通过 miniprofiler 将 EntityFramework 生成的 mysql 查询保存到 Nlog

我一直在寻找EntityProfiler的开源替代品。我的项目在 EF 5.0.0 中,我尝试了 MiniProfiler。由于它是一个 webapi 项目,我无法在 UI 中看到跟踪信息。设法找到vxcore.nlog nuget,但它无法记录从实体框架生成的 sql 查询。这是我的代码

这是我的日志文件输出

20170324013230 SCI-LT-050 ​​在 23-03-2017 20:02:30 http://localhost:61308/ = 4,986.4ms (sql = 23.7ms in 6 cmds)

上面的日志只显示了 sql 的执行时间,而不是查询。有人可以帮忙吗?

0 投票
1 回答
2496 浏览

sql - Linq2DB Nlog 或日志记录

有没有办法用 NLog 记录对数据库进行的所有 linq2DB sql 查询?

我找不到任何现实的例子。miniprofiler 有一些东西,但这对我没有帮助,因为我没有使用它的经验。

拉取请求

例子

示例 2