Is it possible to use visual studio performance profiling with a service fabric?

Hope this is just ...

I want the performance profile to work with the production service cluster.

So far I: - Go to the "Start Diagnostic Tools" section without debugging. - Go through the wizard by selecting my service project as the launch project. - Then he asks which projects to include, so I turn on my exe service - Then I select the tools (I want method level synchronization)

Then I press start and exe immediately drops. I assume that this is due to the fact that visual studio is trying to start my "service" outside the context of the working environment as a standalone exe.

Not sure what to do with it though ...

Stack trace:

DEBUG: Parameter Activation

Unhandled exception: System.Fabric.FabricConnectionDeniedException: not allowed to connect ---> System.Runtime.InteropServices.COMException: exception from HRESULT: 0x80071C43 in System.Fabric.Interop.NativeRuntime.FabricEndGetNodeContext (context IFabricabriconFOration. NativeFabricRuntimeFactory.GetNodeContextEndWrapper (IFabricAsyncOperationContext context) in System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish (IFabricAsyncOperationContext context, boolean expired synchronously) --- End of the internal check of the exceptionSunter.current.uccessProcess.accessComputerTervices.etherService.etherCompar.Terrent.Tercher.Terrent.Tercome.TerCommentservice.Terrent.current.Task task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task) in Microsoft.ServiceFabric.Service s.Runtime.RuntimeContext.d__3.MoveNext () --- The end of the stack trace from the previous place where the exception was thrown --- in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (task task) in System.Runtime.CompilerServices.TaskAwaiter .HandleNonSuccessAndDebuggerNotification (Task of the task) in Microsoft.ServiceFabric.Services.Runtime.ServiceRuntime.d__0.MoveNext () --- The end of the stack trace from the previous place where the exception was thrown --- in System.Runtime.CompilerServices.TaskAwaiter.ThrowNonon task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task) in System.Runtime.CompilerServices.TaskAwaiter.GetResult ()

Thanks for the help in advance!

+5
source share
2 answers

What you see is Visual Studio trying to start the host process of your service outside of the Service Fabric runtime. Typically, when you start a service through Visual Studio, you deploy an application project that goes through the process of registering and instantiating your services on your local Fab Fabric cluster.

Instrumentation is currently out of the box with Fabric Fabric projects for this reason. We look at ways to make this possible in the future.

You can still perform sampling profiling, which allows you to attach the profiler to an executable EXE. In this case, you must first deploy your application, and then attach the profiler to your EXE services.

+5
source

See https://msdn.microsoft.com/en-us/library/dd255414.aspx?f=255&MSPPError=-2147217396

  • Initialize profiling environment variables with the VSPerfClrEnv {/globalsamplegc | /globalsamplegclife}[/samplelineoff] variant VSPerfClrEnv {/globalsamplegc | /globalsamplegclife}[/samplelineoff] VSPerfClrEnv {/globalsamplegc | /globalsamplegclife}[/samplelineoff] , then reboot.
  • Run the profiler to collect data using the option:

    VSPerfCmd /START:{COVERAGE|SAMPLE|CONCURRENCY|TRACE} /OUTPUT:file /ATTACH:(pid|name)[,(pid|name)]* [/USER:[domain\]username]

/USER:[domain\]username required if the service or process is running under a different user account.

File extension

A .vspx or .vsp added to the /OUPUT:file specification. You can then open the .vspx or .vsp in Visual Studio to view the profiling report.

Run VSPerfCmd /? for more explanation and to view the full list of profiling options.

0
source

All Articles