![](/img/trans.png)
[英]JetBrains dotTrace, is it possible to profile source code line by line? else I need another tool
[英]Is it possible to profile Azure App Service using Jetbrains DotTrace?
这是我到目前为止所尝试的:
1) 使用 Kudu 将控制台工具上传到应用程序并运行它们。 好吧,这是不可能的,因为不允许写入注册表。
2) 使用 Kudu 上传 RemoteAgent 并运行它。 我得到: No DNS entries exist for host xxx. No such host is known.
No DNS entries exist for host xxx. No such host is known.
从 dotTrace UI 连接到 Kudu 控制台中打印的 URL 时。 App 服务只能监听 80 和 443 端口。
3) 使用 dotTrace SDK 和 JetBrains.Profiler.Api 看起来很有希望。 它不想在 Azure 上附加探查器(与没有问题的本地相反),使用此代码会遇到超时异常。
private void AttachProfiler(ProfilingType profilingType)
{
var folder = AppDomain.CurrentDomain.BaseDirectory;
FileList = GetListFile(folder);
CurrentProfilingType = profilingType.ToString();
SelfAttach.Attach(new SaveSnapshotProfilingConfig
{
ProfilingControlKind = ProfilingControlKind.Api,
SaveDir = Path.Combine(folder, "Temp") ,
RedistDir = Path.Combine(folder, "_JetBrains.Profiler.SelfSdk.2019.1.3"),
ProfilingType = profilingType,
ListFile = FileList
});
SleepUntilAttachedOrTimedOut();
}
private static string GetListFile(string folder)
{
return Path.Combine(folder, "snapshot_list.xml");
}
private void SleepUntilAttachedOrTimedOut()
{
var totalMilliseconds = 0;
while (!CheckProfilerAttached())
{
var intervalMilliseconds = 250;
Thread.Sleep(intervalMilliseconds);
totalMilliseconds += intervalMilliseconds;
if (totalMilliseconds >= 60000)
{
throw new TimeoutException("Could not attach profiler. Timeout.");
}
}
}
private bool CheckProfilerAttached() => SelfAttach.State == SelfApiState.Active;
目前不可能。 此处创建的问题: https://youtrack.jetbrains.com/issue/PROF-921
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.