我环顾了 Azure 门户并搜索了网络,但我一直无法找到答案。有没有办法,也许通过 api 或 powershell,来获取 webjobs 的指标?例如每个工作的平均运行时间?我还想找出 webjob 触发的消息的平均排队时间(尽管这可能是存储指标而不是 webjob 指标)。任何指针将不胜感激。
问问题
323 次
2 回答
2
不要认为没有 3rd 方服务这是可能的。事实上,我所知道的唯一一个专门做这件事的是CloudMonix,我隶属于它。
于 2016-03-21T21:22:59.597 回答
2
正如伊戈雷克所说,我认为这也不可能。有许多工具可以监控应用程序。其中两个具有 Azure 集成:
我使用 Application Insights 从网络作业发送指标。您可以按照本教程在您的网络作业中设置应用程序洞察:
如果要计算处理队列中消息的时间,可以执行以下操作:
public async Task ProcessAsync([ServiceBusTrigger("queueName")] BrokeredMessage incommingMessage)
{
var stopwatch = Stopwatch.StartNew();
// Process your message
...
stopwatch.Stop();
// You should only instantiate the TelemetryClient once in your application.
var telemetryClient = new TelemetryClient() { InstrumentationKey = "MyInstrumentationKey"};
//Send your metric
telemetryClient.TrackMetric("ProcessQueueMessageElapsedTime", stopwatch.ElapsedMilliseconds);
}
于 2016-03-22T20:37:00.500 回答