Skip to content

Instantly share code, notes, and snippets.

@Geertvdc
Created January 31, 2019 07:56
Show Gist options
  • Save Geertvdc/548512a03a39de03104ff90e730d8727 to your computer and use it in GitHub Desktop.
Save Geertvdc/548512a03a39de03104ff90e730d8727 to your computer and use it in GitHub Desktop.
Calculation times in Log Analytics query
let today = dependencies
| where timestamp between( now(-1d) .. now() )
| where name == "CalculationCycle"
| project value , timestamp, hour=datepart("Hour",timestamp)
| summarize avg(value) by bin(hour,1)
| sort by hour asc;
let lastmonth = dependencies
| where timestamp between( now(-30d) .. now(-1d))
| where name == "CalculationCycle"
| project value , timestamp, hour=datepart("Hour",timestamp)
| summarize percentiles(value, 90) by bin(hour,1)
| sort by hour asc;
today | join kind= inner (lastmonth) on hour
| project hour, avg_value , percentile_value_90
| sort by hour asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment