looking for a KQL query to convert percentiles(duration, 95) values into secs

Nikhil Sabhani 0 Reputation points
2023-04-06T16:57:53.2233333+00:00

let dataset=requests
    // additional filters can be applied here
    | where client_Type != "Browser"
    | where operation_Name has 'POST'
    | where (cloud_RoleName == '1234' or cloud_RoleName == '5678');
// calculate duration percentiles and count for all requests (overall)
dataset
| summarize
    avg_duration=sum(itemCount * duration) / sum(itemCount),
    percentiles(duration, 95),
    count_=sum(itemCount)
| project
    operation_Name="Overall",
    avg_duration,
    percentile_duration_95,
    count_
| union(dataset
    // change 'operation_Name' on the below line to segment by a different property
    | summarize
        avg_duration=sum(itemCount * duration) / sum(itemCount),
        percentiles(duration, 95),
        count_=sum(itemCount)
        by operation_Name
    | sort by avg_duration desc, count_ desc
    )
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,512 questions
{count} votes