簡體   English   中英

Azure WebJobs和隊列相關指標

[英]Azure WebJobs and Queue Related Metrics

我環顧了Azure門戶並搜索了網絡,但無法找到答案。 是否可以通過api或powershell來獲取有關webjobs的指標? 例如每個作業的平均運行時間? 我還想找出觸發Webjob的消息的平均排隊時間(盡管這可能是存儲指標而不是Webjob指標)。 任何指針將不勝感激。

不要認為沒有第三方服務就不可能實現這一點。實際上,我所知道的唯一做到這一點的就是CloudMonix ,我隸屬於該公司。

正如Igorek所說,我也不可能。 有很多工具可以監視應用程序。 其中兩個具有Azure集成:

我已使用Application Insights從Webjob發送指標。 您可以按照本教程設置Web作業中的應用程序見解:

如果要計算從隊列處理消息的時間,可以執行以下操作:

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);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM