nootn / miniprofiler.windows Goto Github PK
View Code? Open in Web Editor NEWExtends the fantastic MiniProfiler and adds functionality to make it easy to use in windows based applications (E.g. console applications)
Extends the fantastic MiniProfiler and adds functionality to make it easy to use in windows based applications (E.g. console applications)
I've followed the Quickstart at http://nootn.github.io/MiniProfiler.Windows/, and made different variations to the packages config, installed fasterflect and I still get that "Method 'Start' in type 'MiniProfiler.Windows.ConsoleProfilingProvider' from assembly 'MiniProfiler.Windows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation."
This is on Visual Studio on a clean project with framework set to 4 and 4.5.2.
I'm using MiniProfiler.Windows in a while loop to measure the execution time of each iteration. The memory consumption of this program is quickly getting out of control (have seen upwards of 600mb extra memory in just a couple of minutes). When I stopped using MiniProfiler.Windows it all got back to the way it was. Either I'm missing some cleanup code, or there is a bug in MiniProfiler.Windows.
An example
public void HandleIncomingData()
{
while(true)
{
ConsoleProfiling.Start();
// Do some data processing here...
Console.WriteLine(ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings());
}
}
I am facing the following error
"Method 'Start' in type 'MiniProfiler.Windows.ConsoleProfilingProvider' from assembly 'MiniProfiler.Windows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. I am using MiniProfiler version 3.1.1.140
I installed MiniProfiler.Windows 1.0.0 Nuget package in my EF 6.1 winform project (.NET 4)
and used in following code:
public class MiniProfilerQueryHandlerDecorator<TQuery, TResult> : IQueryHandler<TQuery, TResult>
where TQuery : IQueryParameter<TResult>
{
private readonly IQueryHandler<TQuery, TResult> _decoratee;
public MiniProfilerQueryHandlerDecorator(IQueryHandler<TQuery, TResult> decoratee)
{
_decoratee = decoratee;
}
public TResult Handle(TQuery request)
{
TResult result;
using (StackExchange.Profiling.MiniProfiler.Current.Step("Call QueryHandler"))
{
result =_decoratee.Handle(request);
}
var friendlyString = ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings();
Console.WriteLine(friendlyString);
Debug.WriteLine(friendlyString);
return result;
}
}
but in runtime I get following MissingMethodException:
{"Method not found: 'Boolean StackExchange.Profiling.MiniProfiler.get_HasSqlTimings()'."}
at MiniProfiler.Windows.ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings(Int32 includeSqlWithDurationMoreThanMilliseconds, Int32 takeTopNumberOfQueries)
at IASCo.Application.Core.CQRS.Query.QueryHandlerDecorators.MiniProfilerQueryHandlerDecorator2.Handle(TQuery request) in e:\DevProjects\PPL\SRC\NewStructure\IASCo.Application.Core\CQRS\Query\QueryHandlerDecorators\MiniProfilerQueryHandlerDecorator.cs:line 27 at Level4UI.Lists.BaseListFormStructure
4.LoadPageData(Expression1 predicate) in e:\DevProjects\PPL\SRC\Level4UI\Lists\BaseListFormStructure.cs:line 46 at Level4UI.Lists.NewListForm
4..ctor(BaseListFormStructure`4 listFormStructure, String clickedMenu) in e:\DevProjects\PPL\SRC\Level4UI\Lists\NewListForm.cs:line 72
at Level4UI.MainForm.NavigationItemsClicked(Object sender, NavBarLinkEventArgs e) in e:\DevProjects\PPL\SRC\Level4UI\MainForm.cs:line 422
at DevExpress.XtraNavBar.NavBarItem.RaiseLinkEvent(Object linkEvent, NavBarItemLink link)
at DevExpress.XtraNavBar.NavBarItem.RaiseLinkClicked(NavBarItemLink link)
at DevExpress.XtraNavBar.NavBarItem.RaiseLinkClickedCore(NavBarItemLink link)
at DevExpress.XtraNavBar.NavBarControl.RaiseLinkClicked(NavBarItemLink link)
at DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.DoLinkClick(NavBarHitInfo hitInfo)
at DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.DoClick(NavBarHitInfo hitInfo)
at DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.OnMouseUp(MouseEventArgs e)
at DevExpress.XtraNavBar.NavBarControl.OnMouseUp(MouseEventArgs ev)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraNavBar.NavBarControl.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Level4UI.Program.Main() in e:\DevProjects\PPL\SRC\Level4UI\Program.cs:line 77
at var friendlyString = ConsoleProfiling.StopAndGetConsoleFriendlyOutputStringWithSqlTimings(); line.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.