Getting total milliseconds of a timespan in Analytics Query Language

Viewed 5198

I'm trying to render the difference between two dates over time in Application Insights Analytics, but timespan isn't a supported type for the y-axis of a timechart.

Example query:

customMetrics
| extend dateDiff = timestamp - (timestamp - 1m) 
// my second date comes from customDimensions
| summarize max(dateDiff) by bin(timestamp, 10m)
| order by timestamp desc
| render timechart

I'd like to transform my dateDiff timespan into an integer representing the number of milliseconds but I can't find anything in their documentation that supports this. I basically want C#'s TimeSpan.TotalMilliseconds().

1 Answers
Related